-
Notifications
You must be signed in to change notification settings - Fork 414
New issue
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
Version 1.2.0 doesn't detect JDK installed via Homebrew well #2254
Comments
@brunovieira97 could you try Clean the workspace directory |
Tried that before submitting the issue. Did not help. Even uninstalling the extension, or VS Code entirely had no effect at all. |
@brunovieira97 could you run
|
Here it goes.
export PATH="/opt/homebrew/opt/openjdk/bin:$PATH" |
Could you try the following:
|
Still the same behavior. As I detailed previously, I have even uninstalled and installed other versions of the JDK and it had no impact. The problem is clearly related to v1.2.0 of the extension. If I rollback to 1.1.0, as I said, no problems are reported for the source files. Anyway, here's the output for the commands you recommended, after I exported
|
I can't reproduce it. Could you try the latest build - https://download.jboss.org/jbosstools/jdt.ls/staging/java-1.3.0-490/java-1.3.0-490.vsix |
Still facing the same problem with the 1.3.0 .vsix. Did you try reproducing it with the same JDK, extension version and project? Perhaps there are other specific logs or some way for me to demonstrate this issue on a Zoom call for any contributor? Let me know, I'm happy to help in any way I can. |
Could not reproduce the issue on my Windows laptop. I'm using Settings Sync, and installed the same JDK distribution and version, as well as same version of all VS Code extensions and the editor itself. Could it be related to the platform then? |
Yes, it could. I have tested on Linux and Windows. |
Can't reproduce on Linux. I was able to use Java 17 and Java 18 today using v1.2.0 of the extension. However, I've had the issue you're describing here before. It was something to do with misconfigured JDKs. If I were you, I'd read over https://code.visualstudio.com/docs/java/java-project#_configure-runtime-for-projects and make sure the JDK you intend to use is included in that array of objects in the settings. Then, ensure that VS Code chooses the right JDK for your project by setting your toolchain version in your
|
The default JDK path via The actual JDK home is placed at the subfolder @brunovieira97 Regarding your machine, the correct JAVA_HOME should be Could you export export JAVA_HOME="/opt/homebrew/opt/openjdk/libexec/openjdk.jdk/Contents/Home" |
@Eskibear This is a new corner case that the new findJavaHome lib |
Homebrew creates a lot of symbolic links, I find we can only rely on I've covered this case in latest jdk-utils. If you have a NodeJS runtime, you can run below command to test if your installed JDK is detected.
Below is my smoke test.
UPDATEI just find on https://docs.brew.sh/Installation, location of homebrew is different per platform.
|
Homebrew covered on both Apple Silicon and Linux in jdk-utils@0.4.2, see Eskibear/node-jdk-utils#5 (comment) |
@brunovieira97 |
@testforstephen was able to test today and it's working as expected now. Thank you for fixing this so fast, everyone! |
I've been using the extension for some time now. A couple of days ago, I've updated it to 1.2.0 and since then, when opening a study project it would report errors for everything.
Some of the errors include not finding
Object
's default no args constructor, failing to import basic core classes from Java (i.e.java.util
,java.date
), and so on.I've already removed my JDK 17 installation, replacing it with JDK 11, and that had no effect. Only fix I've found is to rollback the extension to the previous version (1.1.0, from 3w ago).
Some screenshots are attached to show the errors I'm facing.
Environment
Steps To Reproduce
Example project: https://github.com/brunovieira97/alura-novidades-java
Logs: Logs.zip
Current Result
Expected Result (v1.1.0)
Additional Informations
openjdk
via brew and installedopenjdk@11
, properly linking it. No effect at allThe text was updated successfully, but these errors were encountered: