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

JDK 17 passing add-opens as a parameter #6095

Open
luf opened this issue Dec 30, 2024 · 6 comments
Open

JDK 17 passing add-opens as a parameter #6095

luf opened this issue Dec 30, 2024 · 6 comments
Labels
status/need-feedback Calling participant to provide feedback

Comments

@luf
Copy link

luf commented Dec 30, 2024

Description:
We need to pass --add-opens parameter to batch job applications with SCDF as specified below, but when we pass, it splits parameter with white-space wrongly.
https://stackoverflow.com/questions/28327620/difference-between-java-options-java-tool-options-and-java-opts

When we provide below parameter;
_JAVA_OPTIONS=--add-opens java.base/java.lang=ALL-UNNAMED

It splits them as two different argument as;

  1. _JAVA_OPTIONS=--add-opens
  2. java.base/java.lang=ALL-UNNAMED

and throws exception for using / character as parameter key.

See;
https://stackoverflow.com/questions/74783705/unrecognized-option-add-opens-when-passed-with-java-options

Release versions:
2.11.4

All known escaping methods have been tried, (backslash, backslash+double-quote, double-quote, double single-quote etc)

Since each batch application may have different module openings with Java 17, do you have any guidance on how to specify the application specifically?

@github-actions github-actions bot added the status/need-triage Team needs to triage and take a first look label Dec 30, 2024
@corneil
Copy link
Contributor

corneil commented Dec 30, 2024

Which platform are you using? Local, Local-Docker, Kubernetes or Cloud Foundry?

@luf
Copy link
Author

luf commented Dec 30, 2024

Sorry I missed to mention it; Kubernetes

@corneil
Copy link
Contributor

corneil commented Dec 30, 2024

@luf How are you passing the configured the values?

If you put double quotes around the value it should be treated as one and not split.
e.g. _JAVA_OPTIONS="--add-opens java.base/java.lang=ALL-UNNAMED"

@corneil
Copy link
Contributor

corneil commented Dec 30, 2024

@luf Do you want to set this for all applications launched or just a specific application?

@luf
Copy link
Author

luf commented Dec 30, 2024

@corneil
with the Kubernetes, we need to pass all arguments as a single String, so it need to be written with escape character, and below methods doesnt work
parameters="someOption=someValue _JAVA_OPTIONS=backslash"--add-opens java.base/java.lang=ALL-UNNAMED backslash" "
parameters="someOption=someValue _JAVA_OPTIONS='--add-opens java.base/java.lang=ALL-UNNAMED' "
parameters="someOption=someValue _JAVA_OPTIONS=--add-opens java.base/java.lang=ALL-UNNAMED "

Just a specific application

@corneil
Copy link
Contributor

corneil commented Dec 30, 2024

@corneil corneil added status/need-feedback Calling participant to provide feedback and removed status/need-triage Team needs to triage and take a first look labels Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/need-feedback Calling participant to provide feedback
Projects
None yet
Development

No branches or pull requests

2 participants