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

Use JAVA_HOME instead of JAVA_CMD in windows bat file? #2479

Open
didibus opened this issue Nov 11, 2018 · 5 comments
Open

Use JAVA_HOME instead of JAVA_CMD in windows bat file? #2479

didibus opened this issue Nov 11, 2018 · 5 comments

Comments

@didibus
Copy link

didibus commented Nov 11, 2018

I find it weird that lein uses JAVA_CMD as the environment variable to find the path to Java if java isn't on the path. It is more standard to have JAVA_HOME point to the Java install. Only lein uses JAVA_CMD. Even the official Java doc mentions JAVA_HOME: https://docs.oracle.com/cd/E19182-01/820-7851/inst_cli_jdk_javahome_t/

Could we not change lein so it also checks JAVA_HOME?

@technomancy
Copy link
Owner

Sure; I haven't used many other java systems that do this, but if it's a common idiom then I'd take a patch to make it work this way. The only caveat is that it should be supported consistently across all the different implementations, and that JAVA_CMD should still take precedence if set, because it's more specific.

@danielcompton
Copy link
Collaborator

danielcompton commented Nov 12, 2018

In my experience this is a common idiom, there's even java_home program that comes with Java for determining the directory of your Java home if you have multiple JDK's installed. For one third-party example, see Cassandra.

$ /usr/libexec/java_home -v 1.8
/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home

@winks
Copy link
Collaborator

winks commented Nov 12, 2018

Guess we could get that in for the next minor release and deprecate JAVA_CMD for 3.0?

@technomancy
Copy link
Owner

Yeah, I would take a patch for this.

@Krchi
Copy link

Krchi commented May 31, 2019

@technomancy !USERPROFILE! in lein.bat should be replaced with %USERPROFILE%

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

No branches or pull requests

5 participants