Skip to content
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

openjdk should not set JAVA_HOME #626

Open
soloturn opened this issue Oct 13, 2024 · 8 comments
Open

openjdk should not set JAVA_HOME #626

soloturn opened this issue Oct 13, 2024 · 8 comments
Assignees
Labels

Comments

@soloturn
Copy link

soloturn commented Oct 13, 2024

JAVA_HOME is an unnecessary variable, as this can be detected from the running java program. setting it causes subsequent errors, like the microsoft vscode java plugin thinks all of a sudden JAVA_HOME should be used to detect an installed java, instead of just looking into the path, resp running java.

but, openjdk should set a link so the path can be set sometimes to java-21 and java-17 with ease, e.g. /program-files/openjdk-21 pointing to /program-files/Microsoft\jdk-21.0.4.7-hotspot\bin

@karianna
Copy link
Member

We typically recommend SDKMan or jenv to resolve being able to select between multiple JVMs and having JAVA_HOME set appropriately each time.

@soloturn
Copy link
Author

soloturn commented Oct 14, 2024

how could the use of sdkman or jenv influence if the microsoft openjdk package sets java_home on install and should not set it @karianna ?

@karianna
Copy link
Member

@soloturn - Do you mean our MSI installer that sets this variable?

@soloturn
Copy link
Author

i am not 100% sure where it came from. if i recall correctly i used winget to install, so i assumed it is in the msi.

@karianna
Copy link
Member

Assigned to @brunoborges as part of his standardization for Windows installers investigation. To set expectations, there's no short term changes planned, but we are looking to see if the OpenJDK is willing to align on an approach here.

@soloturn
Copy link
Author

i installed zulu jdk recently, and the installer asked if i want to set java_home. so it is definitvely in the installer, not in openjdk.

@brunoborges
Copy link
Member

@soloturn when you installed Zulu, did you install with the graphical interface of the MSI, or did you install through WinGet?

The MS JDK MSI installer graphical UI does ask if the user wants to set JAVA_HOME. But when one installs with winget, it is enabled by default, as that is the intent of the majority of users. Advanced users may want to use a different installation method

@soloturn
Copy link
Author

soloturn commented Nov 1, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants