-
Bug
-
Resolution: Fixed
-
P3
-
14, 15, 16
-
b08
-
generic
There are systems that updates LD_LIBRARY_PATH or directly returns JNI_TRUE in method RequiresSetenv(const char *jvmpath) from java_md.c file [1] to request re-execution of the current executable.
This can have some unpredictable side effects like passing not expected arguments to the current executable which forms them from a config file.
The root cause of the issue is that a jpackage application expects one number of arguments but JLI re-executes them with another number of arguments.
For example, a jpackage application can be run with arguments:
./app/bin/app -Dparam2=Param2 B1 B2 B3
it adds arguments from the config file and calls JLI with arguments:
app/bin/app -classpath -Dparam1=Param1 -m com.hello/com.hello.Hello -Dparam2=Param2 B1 B2 B3
JLI re-executes the app with new arguments so the app adds some arguments one more time after the re-execution.
./app/bin/app -classpath -Dparam1=Param1 -m com.hello/com.hello.Hello -classpath -Dparam1=Param1 -m com.hello/com.hello.Hello -Dparam2=Param2 B1 B2 B3
[1] https://hg.openjdk.java.net/jdk/jdk/file/f0792f0ffce9/src/java.base/unix/native/libjli/java_md.c#l227
This can have some unpredictable side effects like passing not expected arguments to the current executable which forms them from a config file.
The root cause of the issue is that a jpackage application expects one number of arguments but JLI re-executes them with another number of arguments.
For example, a jpackage application can be run with arguments:
./app/bin/app -Dparam2=Param2 B1 B2 B3
it adds arguments from the config file and calls JLI with arguments:
app/bin/app -classpath -Dparam1=Param1 -m com.hello/com.hello.Hello -Dparam2=Param2 B1 B2 B3
JLI re-executes the app with new arguments so the app adds some arguments one more time after the re-execution.
./app/bin/app -classpath -Dparam1=Param1 -m com.hello/com.hello.Hello -classpath -Dparam1=Param1 -m com.hello/com.hello.Hello -Dparam2=Param2 B1 B2 B3
[1] https://hg.openjdk.java.net/jdk/jdk/file/f0792f0ffce9/src/java.base/unix/native/libjli/java_md.c#l227
- duplicates
-
JDK-8240438 Test test/jdk/tools/jpackage/share/JavaOptionsTest.java fails on Alpine Linux
- Closed
- relates to
-
JDK-8289201 Cannot start jpackage launcher inside another jpackage launcher
- Closed