openapi-generator-cli
openapi-generator-cli copied to clipboard
support JAVA_HOME environment variable
fixes #661
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.
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.
I don't have time immediately, but I can look into the failing tests at some point.
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 can you please file a new PR based on this one and resolve the merge conflicts?
thanks for the PR.
closed via https://github.com/OpenAPITools/openapi-generator-cli/pull/756 instead