ADDITIONAL SYSTEM INFORMATION :
OpenJDK 22 on Windows 11
A DESCRIPTION OF THE PROBLEM :
Current revisions of jpackage generate exe launchers for Windows that by design always spawn 2 instances:
https://bugs.openjdk.org/browse/JDK-8272328
The reason for this is adding the "app" folder to the java.library.path by default, which can only be done via the %PATH% environment variable due to jli internals, but %PATH% cannot be changed for the current process due to Windows internals, so the process starts another instance with a slightly altered environment. This is clunky, but acceptable *if* auto-adding "app" folder to the java.library.path were indeed necessary. However, it's not necessary if there's no *.dll files in the "app" folder, it's not necessary if java.library.path is set via java-options already, etc.
The "first instance starts second instance which then launches the application" behavior is especially odd for win-console exe launchers since the first console exe will wait for the second console exe to finish before they can both exit.
I would like to request a way to disable this "restart" behavior since it doesn't do anything for me.
I would recommend checking the java-options= list and for a java.library.path= entry and then not do the "restart" behavior if the developer has already manually set the library path correctly.
REGRESSION : Last worked in version 16
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
jpackages should generate exe files that (if possible) only spawn 1 process
ACTUAL -
exe files generated by jpackage spawn 2 processes
FREQUENCY : always
OpenJDK 22 on Windows 11
A DESCRIPTION OF THE PROBLEM :
Current revisions of jpackage generate exe launchers for Windows that by design always spawn 2 instances:
https://bugs.openjdk.org/browse/JDK-8272328
The reason for this is adding the "app" folder to the java.library.path by default, which can only be done via the %PATH% environment variable due to jli internals, but %PATH% cannot be changed for the current process due to Windows internals, so the process starts another instance with a slightly altered environment. This is clunky, but acceptable *if* auto-adding "app" folder to the java.library.path were indeed necessary. However, it's not necessary if there's no *.dll files in the "app" folder, it's not necessary if java.library.path is set via java-options already, etc.
The "first instance starts second instance which then launches the application" behavior is especially odd for win-console exe launchers since the first console exe will wait for the second console exe to finish before they can both exit.
I would like to request a way to disable this "restart" behavior since it doesn't do anything for me.
I would recommend checking the java-options= list and for a java.library.path= entry and then not do the "restart" behavior if the developer has already manually set the library path correctly.
REGRESSION : Last worked in version 16
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
jpackages should generate exe files that (if possible) only spawn 1 process
ACTUAL -
exe files generated by jpackage spawn 2 processes
FREQUENCY : always
- relates to
-
JDK-8272328 java.library.path is not set properly by Windows jpackage app launcher
-
- Resolved
-
-
JDK-8343308 Document properties in jpackage app launcher config file
-
- Open
-
- links to
-
Commit(master) openjdk/jdk/29882bfe
-
Review(master) openjdk/jdk/21726