From b157f8f4b885693dd60c1d67c655a35fcf754b2f Mon Sep 17 00:00:00 2001 From: Chris Date: Fri, 9 Jul 2021 11:33:19 -0400 Subject: java updates --- utils/bin/java-linux-ls | 28 ---------------------- utils/bin/java-mac-ls | 63 ------------------------------------------------- utils/bin/jdtls | 63 +++++++++++++++++++++++++++++++++++++++++++++++++ utils/bin/nv | 2 -- 4 files changed, 63 insertions(+), 93 deletions(-) delete mode 100755 utils/bin/java-linux-ls delete mode 100755 utils/bin/java-mac-ls create mode 100755 utils/bin/jdtls delete mode 100755 utils/bin/nv (limited to 'utils') diff --git a/utils/bin/java-linux-ls b/utils/bin/java-linux-ls deleted file mode 100755 index c5ea391a..00000000 --- a/utils/bin/java-linux-ls +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env bash - -# NOTE: -# This doesn't work as is on Windows. You'll need to create an equivalent `.bat` file instead -# -# NOTE: -# If you're not using Linux you'll need to adjust the `-configuration` option -# to point to the `config_mac' or `config_win` folders depending on your system. - -JAR="$HOME/.config/nvim/.language-servers/eclipse.jdt.ls/org.eclipse.jdt.ls.product/target/repository/plugins/org.eclipse.equinox.launcher_*.jar" -GRADLE_HOME=$HOME/gradle $HOME/.sdkman/candidates/java/current/bin/java \ - -Declipse.application=org.eclipse.jdt.ls.core.id1 \ - -Dosgi.bundles.defaultStartLevel=4 \ - -Declipse.product=org.eclipse.jdt.ls.core.product \ - -Dlog.protocol=true \ - -Dlog.level=ALL \ - -javaagent:/usr/local/share/lombok/lombok.jar \ - -Xms1g \ - -Xmx2G \ - -jar $(echo "$JAR") \ - -configuration "$HOME/.config/nvim/.language-servers/eclipse.jdt.ls/org.eclipse.jdt.ls.product/target/repository/config_linux" \ - -data "${1:-$HOME/workspace}" \ - --add-modules=ALL-SYSTEM \ - --add-opens java.base/java.util=ALL-UNNAMED \ - --add-opens java.base/java.lang=ALL-UNNAMED - - # for older java versions if you wanna use lombok - # -Xbootclasspath/a:/usr/local/share/lombok/lombok.jar \ diff --git a/utils/bin/java-mac-ls b/utils/bin/java-mac-ls deleted file mode 100755 index 952ddddc..00000000 --- a/utils/bin/java-mac-ls +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/env bash - -# NOTE: -# This doesn't work as is on Windows. You'll need to create an equivalent `.bat` file instead -# -# NOTE: -# If you're not using Linux you'll need to adjust the `-configuration` option -# to point to the `config_mac' or `config_win` folders depending on your system. - -case Darwin in - Linux) - CONFIG="/Users/chris/.local/share/nvim/lspinstall/java/config_linux" - ;; - Darwin) - CONFIG="/Users/chris/.local/share/nvim/lspinstall/java/config_mac" - ;; -esac - - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# JAR="$HOME/.config/nvim/.language-servers/eclipse.jdt.ls/org.eclipse.jdt.ls.product/target/repository/plugins/org.eclipse.equinox.launcher_*.jar" -JAR="/Users/chris/.local/share/nvim/lspinstall/java/plugins/org.eclipse.equinox.launcher_*.jar" -GRADLE_HOME=$HOME/gradle "$JAVACMD" \ - -Declipse.application=org.eclipse.jdt.ls.core.id1 \ - -Dosgi.bundles.defaultStartLevel=4 \ - -Declipse.product=org.eclipse.jdt.ls.core.product \ - -Dlog.protocol=true \ - -Dlog.level=ALL \ - -javaagent:$HOME/.local/share/nvim/lspinstall/java/lombok.jar \ - -Xms1g \ - -Xmx2G \ - -jar $(echo "$JAR") \ - -configuration "$CONFIG" \ - -data "${1:-$HOME/workspace}" \ - --add-modules=ALL-SYSTEM \ - --add-opens java.base/java.util=ALL-UNNAMED \ - --add-opens java.base/java.lang=ALL-UNNAMED - - # for older java versions if you wanna use lombok - # -Xbootclasspath/a:/usr/local/share/lombok/lombok.jar \ - - # -javaagent:/usr/local/share/lombok/lombok.jar \ diff --git a/utils/bin/jdtls b/utils/bin/jdtls new file mode 100755 index 00000000..952ddddc --- /dev/null +++ b/utils/bin/jdtls @@ -0,0 +1,63 @@ +#!/usr/bin/env bash + +# NOTE: +# This doesn't work as is on Windows. You'll need to create an equivalent `.bat` file instead +# +# NOTE: +# If you're not using Linux you'll need to adjust the `-configuration` option +# to point to the `config_mac' or `config_win` folders depending on your system. + +case Darwin in + Linux) + CONFIG="/Users/chris/.local/share/nvim/lspinstall/java/config_linux" + ;; + Darwin) + CONFIG="/Users/chris/.local/share/nvim/lspinstall/java/config_mac" + ;; +esac + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# JAR="$HOME/.config/nvim/.language-servers/eclipse.jdt.ls/org.eclipse.jdt.ls.product/target/repository/plugins/org.eclipse.equinox.launcher_*.jar" +JAR="/Users/chris/.local/share/nvim/lspinstall/java/plugins/org.eclipse.equinox.launcher_*.jar" +GRADLE_HOME=$HOME/gradle "$JAVACMD" \ + -Declipse.application=org.eclipse.jdt.ls.core.id1 \ + -Dosgi.bundles.defaultStartLevel=4 \ + -Declipse.product=org.eclipse.jdt.ls.core.product \ + -Dlog.protocol=true \ + -Dlog.level=ALL \ + -javaagent:$HOME/.local/share/nvim/lspinstall/java/lombok.jar \ + -Xms1g \ + -Xmx2G \ + -jar $(echo "$JAR") \ + -configuration "$CONFIG" \ + -data "${1:-$HOME/workspace}" \ + --add-modules=ALL-SYSTEM \ + --add-opens java.base/java.util=ALL-UNNAMED \ + --add-opens java.base/java.lang=ALL-UNNAMED + + # for older java versions if you wanna use lombok + # -Xbootclasspath/a:/usr/local/share/lombok/lombok.jar \ + + # -javaagent:/usr/local/share/lombok/lombok.jar \ diff --git a/utils/bin/nv b/utils/bin/nv deleted file mode 100755 index 87e5e72a..00000000 --- a/utils/bin/nv +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -nvim -u ~/.config/nvim/init.lua -- cgit v1.2.3