Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8093766

JavaFX Packager's launcher only works with JDK not JRE

    XMLWordPrintable

    Details

      Description

      From customer Todd Peterson.

      The packagers launcher does not work with the JRE directory structure. Line 110 of main.m for the Mac loads the Java library from only the JDK directory structure:

      NSString *libjliPath = [runtimePath stringByAppendingPathComponent:@"Contents/Home/jre/lib/jli/libjli.dylib"];

      Windows and Linux also need to be addressed.


      Workaround: create a symlink in the JRE after the bundling is complete something like this:

      ln -s jre1.7.0_45.jre/Contents/Home jre1.7.0_45.jre/Contents/Home/jre

      this way the launcher will see "jre" directory and load the Java library.


      Explanation of the problem from the customer:

      "To get my application running with an embedded Java 1.7.0_45 JRE, I used javafxpackager to create an application bundle. The resulting Info.plist file had the following to specify the JVM runtime:

      <key>JVMRuntime</key>
       <string>jdk1.7.0_45.jdk</string>

      This worked fine. However I learned from my manager I need to use the JRE distribution of 1.7.0_45, so I dropped in the JRE bundle ("jre1.7.0_45.jre") into my Contents/PlugIns folder and changed the JVMRuntime value to jre1.7.0_45.jre. My application no longer starts up. Looking at the 2 Java bundles, there is a difference in the directory structure - namely the jdk version has an extra "jre" directory in it:

      Contents/
             /PlugIns
                     /jdk1.7.0_45.jdk
                             /Contents
                                     /Home
                                             /jre
                                                     /bin/...
                                                     /COPYRIGHT
                                                     /lib/...
                                                     /LICENSE
                                                     /README
                                                     /THIRDPARTYLICENSEREADME-JAVAFX.txt
                                                     /THIRDPARTYLICENSEREADME.txt
                                                     /Welcome.html

      Versus the JRE having the following:

                     /jre1.7.0_45.jre
                             /Contents
                                     /Home
                                             /bin/...
                                             /COPYRIGHT
                                             /lib/...
                                             /LICENSE
                                             /man/...
                                             /README
                                             /release
                                             /README
                                             /THIRDPARTYLICENSEREADME-JAVAFX.txt
                                             /THIRDPARTYLICENSEREADME.txt
                                             /Welcome.html
                                     /Info.plist
                                     /MacOS
                 

      If I add a directory named jre to the JRE directory structure, my application runs. My question is why the difference? Is there something I could add to my Info.plist to use the JRE version as it is untarred? I suspect this may be caused by how the stub JavaAppLauncher works.'s"

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              cbensen Chris Bensen (Inactive)
              Reporter:
              cbensen Chris Bensen (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Due:
                Created:
                Updated:
                Resolved:
                Imported: