-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
jetty.sh ignores JAVA_OPTIONS environment variable #7754
Comments
That means JAVA_OPTIONS must come from your Your change allows for a forked JVM. The other option you have is to use |
thanks a lot for the explanation |
It seems that $JETTY_SYS_PROPS is redefined in the jetty.sh like that I've tried to use the jvm module. I've set system properties in jvm.ini with the -DMY_VAR=VALUE syntax. However, in the RUN_CMD generated by the dry run, ${MY_VAR} are not expanded which causes troubles. For instance, in sessions.ini: The RUN_CMD contains -DWORKERNAME=localhost jetty.sessionIdManager.workerName=${WORKERNAME} but ${WORKERNAME} is not expanded even when it is run. |
for property expansion in start modules (be it in for your example, the use of JETTY_ARGS="WORKERNAME=localhost" |
Signed-off-by: Joakim Erdfelt <[email protected]>
…7819) Signed-off-by: Joakim Erdfelt <[email protected]>
Jetty version(s)
10.0.8
Java version/vendor
(use: java -version)
OpenJDK Runtime Environment Corretto-17.0.2.8.1
OS type/version
Amazon Linux 2
Description
Jetty failed to start after migrating from 10.0.6 to 10.0.8 (no jetty-start.log, no jetty.log)
What is strange is that in jetty.sh, JAVA_OPTIONS is mentioned in the doc in the header of the file but it is not used (except in dumpEnv).
I've replaced the following lines:
JETTY_SYS_PROPS=$(echo -ne "-Djetty.home=$JETTY_HOME" "-Djetty.base=$JETTY_BASE" "-Djava.io.tmpdir=$TMPDIR")$JETTY_SYS_PROPS $ {RUN_ARGS[@]})
RUN_ARGS=$("$JAVA" -jar "$JETTY_START" --dry-run=opts,path,main,args ${JETTY_ARGS[*]})
RUN_CMD=("$JAVA"
(note: having "$JAVA" in RUN_ARGS is strange)
by the corresponding lines from jetty.sh in version 10.0.6:
JAVA_OPTIONS=(${JAVA_OPTIONS[]} "-Djetty.home=$JETTY_HOME" "-Djetty.base=$JETTY_BASE" "-Djava.io.tmpdir=$TMPDIR")
RUN_ARGS=(${JAVA_OPTIONS[@]} -jar "$JETTY_START" ${JETTY_ARGS[]})
RUN_CMD=("$JAVA" ${RUN_ARGS[@]})
and now it starts.
The text was updated successfully, but these errors were encountered: