openapi-generator-cli icon indicating copy to clipboard operation
openapi-generator-cli copied to clipboard

support JAVA_HOME environment variable

Open adnbrownie opened this issue 2 years ago • 3 comments

fixes #661

adnbrownie avatar Jan 06 '23 22:01 adnbrownie

Is the path to the java command correctly set in the PATH environment variable in your setup?

If it's, I don't think we need to use JAVA_HOME in the code base as suggested by this PR.

wing328 avatar Jan 28 '23 03:01 wing328

As mentioned in https://github.com/OpenAPITools/openapi-generator-cli/issues/661, it is a common practice in the Java world to go for the JAVA_HOME environment variable. The main reason is that you might need different versions of the JDK for different Java projects, so referring to a global Java installation through the PATH variable might not always suit the needs of the different projects. In the JS world, tools like nvm (Node Version Manager) were introduced for the same purpose.

adnbrownie avatar Feb 02 '23 09:02 adnbrownie

I don't have time immediately, but I can look into the failing tests at some point.

adnbrownie avatar Feb 02 '23 09:02 adnbrownie

i think it would be nicer to use JAVA_HOME or better to configure the java runtime via the openapitools.json.

sometimes there is a JRE/JDK given in the PATH envs from the system, maybe controlled by administrators. overriding this in the user envs would not help.

mok-liee avatar Feb 27 '24 15:02 mok-liee

@mok-liee can you please file a new PR based on this one and resolve the merge conflicts?

wing328 avatar Feb 28 '24 04:02 wing328

thanks for the PR.

closed via https://github.com/OpenAPITools/openapi-generator-cli/pull/756 instead

wing328 avatar Mar 03 '24 06:03 wing328