diff options
author | Chris <[email protected]> | 2021-07-09 01:37:03 -0400 |
---|---|---|
committer | Chris <[email protected]> | 2021-07-09 01:37:03 -0400 |
commit | d539ec951c1ccfd904afa0a1680d34a46619eea3 (patch) | |
tree | 6e2fa8ab009be2db33c514bc5a15e01b7bca8694 /utils/bin | |
parent | 1154032f64eec889e12d4e39ce141ed1bc8f4f28 (diff) |
java tool working on mac
Diffstat (limited to 'utils/bin')
-rwxr-xr-x | utils/bin/java-mac-ls | 42 |
1 files changed, 38 insertions, 4 deletions
diff --git a/utils/bin/java-mac-ls b/utils/bin/java-mac-ls index b7ad1700..952ddddc 100755 --- a/utils/bin/java-mac-ls +++ b/utils/bin/java-mac-ls @@ -7,18 +7,51 @@ # 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 \ +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:/usr/local/share/lombok/lombok.jar \ + -javaagent:$HOME/.local/share/nvim/lspinstall/java/lombok.jar \ -Xms1g \ -Xmx2G \ -jar $(echo "$JAR") \ - -configuration "$HOME/.config/nvim/.language-servers/eclipse.jdt.ls/org.eclipse.jdt.ls.product/target/repository/config_mac" \ + -configuration "$CONFIG" \ -data "${1:-$HOME/workspace}" \ --add-modules=ALL-SYSTEM \ --add-opens java.base/java.util=ALL-UNNAMED \ @@ -27,3 +60,4 @@ GRADLE_HOME=$HOME/gradle $HOME/.sdkman/candidates/java/current/bin/java \ # for older java versions if you wanna use lombok # -Xbootclasspath/a:/usr/local/share/lombok/lombok.jar \ + # -javaagent:/usr/local/share/lombok/lombok.jar \ |