We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug
I see that this is parsing the shell output of java -version and that seems to break:
java -version
$ java -version Picked up JAVA_TOOL_OPTIONS: -Dlog4j2.formatMsgNoLookups=true openjdk version "17.0.8.1" 2023-08-24 OpenJDK Runtime Environment Homebrew (build 17.0.8.1+0) OpenJDK 64-Bit Server VM Homebrew (build 17.0.8.1+0, mixed mode, sharing)
Output of (shell-command-to-string "java -version"):
(shell-command-to-string "java -version")
"Picked up JAVA_TOOL_OPTIONS: -Dlog4j2.formatMsgNoLookups=true openjdk version \"17.0.8.1\" 2023-08-24 OpenJDK Runtime Environment Homebrew (build 17.0.8.1+0) OpenJDK 64-Bit Server VM Homebrew (build 17.0.8.1+0, mixed mode, sharing) "
Can be fixed by tweaking the command as follows:
(defun lsp-java--get-java-version () "Retrieve the java version from shell command." (let* ((java-version-output (shell-command-to-string (concat lsp-java-java-path " -version"))) (version-string (nth 0 (split-string (nth 1 (split-string java-version-output "version")))))) (string-to-number (replace-regexp-in-string "\"" "" version-string))))
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug
I see that this is parsing the shell output of
java -version
and that seems to break:Output of
(shell-command-to-string "java -version")
:Can be fixed by tweaking the command as follows:
The text was updated successfully, but these errors were encountered: