JDK-8143314 : Runtime not respected with INI-configuration while creating native bundle
  • Type: Bug
  • Component: deploy
  • Sub-Component: packager
  • Affected Version: 8u60,9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_8
  • CPU: x86
  • Submitted: 2015-11-17
  • Updated: 2015-11-25
  • Resolved: 2015-11-24
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 JDK 9
8u92Fixed 9Fixed
Description
FULL PRODUCT VERSION :
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.3.9600]

A DESCRIPTION OF THE PROBLEM :
Hi, I'm the maintainer of the javafx-maven-plugin.

After upgrading to newer java-version, the generated .cfg-file changed the format, it is a simple "INI-file" now. That's not the problem, but when I set the bundle-argument "runtime" to null or empty string (for not having any bundled runtime), the generated native bundle is not having the runtime-folder, BUT the generated .cfg-file does contain "app.runtime=$APPDIR\runtime".

I documented my findings at github:
https://github.com/javafx-maven-plugin/javafx-maven-plugin/issues/167

The problem, I found, seems to be the new introduced ini-file-format (which does not respect my setting):
http://hg.openjdk.java.net/openjfx/8u-dev/rt/file/e885b6e60687/modules/fxpackager/src/main/java/com/oracle/tools/packager/AbstractImageBundler.java#l154

The problem is not windows-only, it happens on ubuntu/linux too (but there JRE will be bundled).

REGRESSION.  Last worked in version 8u45

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
on windows:
* set runtime-parameter to empty string: <fx:platform basedir=""/>
* generate native bundle with jdk 1.8 update 60 (or above)
* try to run generated native launcher

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
launcher starting with system JRE
ACTUAL -
launcher not working, says something about not being able to start JVM

REPRODUCIBILITY :
This bug can be reproduced always.

CUSTOMER SUBMITTED WORKAROUND :
Only changing to "older" cfg-file-format makes it possible to launch windows native launcher


Comments
The fix for this bug, which was pushed to 9-dev, was lost during the merge to sandbox-9-jake. If still relevant in jigsaw, it will need to be redone as part of JDK-8143293.
25-11-2015

Please create a backport for 8u76 (8u-dev is now 8u76). Then you can resolve it, adding just the "8u-dev" changeset. Once you do that, you can delete the "HG commit for 8u-dev" comment from the main bug ID.
24-11-2015

Approved to backport to 8u-dev.
24-11-2015

Request for approval (for pushing this patch to 8u-dev): This is a regression introduced in 8u60. The fix is simple and safe.
24-11-2015

This issue was caused by the changes for AppCDS support https://bugs.openjdk.java.net/browse/JDK-8097914 http://cr.openjdk.java.net/~shemnon/RT-39975/webrev.00/ In the createLauncherForEntryPoint method of the WinAppBundler class (and bundler classes for other platforms) + 377 // Generate launcher .cfg file + 378 if (LAUNCHER_CFG_FORMAT.fetchFrom(p).equals(CFG_FORMAT_PROPERTIES)) { + 379 writeCfgFile(p, rootDirectory); + 380 } else { + 381 writeCfgFile(p, new File(rootDirectory, getLauncherCfgName(p)), "$APPDIR\\runtime"); + 382 } We use "$APPDIR\\runtime" for the runtime location but it should be empty string when system JRE requested (native launcher expects empty string for system JRE case).
24-11-2015

Was this regression introduced in 8u60?
24-11-2015

Reopen since this was resolved without valid fixVersion.
24-11-2015

HG commit for 9-dev: http://hg.openjdk.java.net/openjfx/9-dev/rt/rev/a294957d1c43
24-11-2015

Webrev: http://cr.openjdk.java.net/~dcherepanov/8143314/webrev.0/ the patch generates .cfg file with empty "app.runtime" when "basedir" is empty.
19-11-2015