-
-
Notifications
You must be signed in to change notification settings - Fork 141
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
[BUG] cli doesn't support JAVA_HOME, requires the java executable to be on the PATH #661
Comments
Workaround Use a different tool to invoke I use Gradle, with wrapper for the
|
adnbrownie
added a commit
to adnbrownie/openapi-generator-cli
that referenced
this issue
Jan 6, 2023
wing328
pushed a commit
that referenced
this issue
Mar 3, 2024
* support JAVA_HOME environment variable fixes #661 * test(generator-cmd): add consideration of the JAVA_HOME variable * docs: add instructions for the use of JAVA_HOME * fix: add quotes to accept spaces in the JAVA_HOME path * fix: add quotation marks only for windows paths --------- Co-authored-by: Nils Braune <78608305+adnbrownie@users.noreply.github.com>
🎉 This issue has been resolved in version 2.10.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
mok-liee
added a commit
to mok-liee/openapi-generator-cli
that referenced
this issue
Mar 12, 2024
* support JAVA_HOME environment variable fixes OpenAPITools#661 * test(generator-cmd): add consideration of the JAVA_HOME variable * docs: add instructions for the use of JAVA_HOME * fix: add quotes to accept spaces in the JAVA_HOME path * fix: add quotation marks only for windows paths --------- Co-authored-by: Nils Braune <78608305+adnbrownie@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
🐛 Bug Report:
Describe the bug
When running
openapi-generator-cli
via NPM script:Error: 'java' is not recognized as an internal or external command, operable program or batch file.
Steps to Reproduce
Have a clean operating system, with no Java installation.
"Install" the JDK by downloading and then unzipping the portable zip archive, then set
JAVA_HOME
to that location.Expected behavior
Like all other tooling in the Java ecosystem, openapi-generator-cli should try to execute the JDK via
$JAVA_HOME/bin/java
before falling back to looking for the java executable on the path.Operation System (please complete the following information):
Package System (please complete the following information):
Additional context
This is a problem for developers working in more complex environments where they might need to work on multiple separate projects that require different JDK versions. It's not viable to always be swapping the global path between different JDK installations.
This is actually a thing in the Node ecosystem too, you can (and people do) install and run Node via a portable archive, without adding the node / npm executables to the global path.
If
JAVA_HOME
support is added, the readme should be updated to reflect that users don't necessarily need to havejava
on theirPATH
any more.The text was updated successfully, but these errors were encountered: