Skip to content
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

Java 9+ non-compatibility #59

Open
kpepper opened this issue Oct 17, 2018 · 3 comments
Open

Java 9+ non-compatibility #59

kpepper opened this issue Oct 17, 2018 · 3 comments

Comments

@kpepper
Copy link

kpepper commented Oct 17, 2018

I tried running a Maven build with Java 10.0.2 and get the following error from the plugin. It doesn't seem to matter what jvmVersion parameter I specify (even none at all). Specifying an embedded jre doesn't work either, as the jre folder no longer exists in Java 9/10/11 and the plugin tries to copy it. This was using the maven repo version of the plugin.

at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:181)
... 21 more

Caused by: java.lang.ExceptionInInitializerError
at sh.tak.appbundler.CreateApplicationBundleMojo.execute(CreateApplicationBundleMojo.java:378)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
... 21 more
Caused by: java.lang.NumberFormatException: multiple points
at java.base/jdk.internal.math.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1914)
at java.base/jdk.internal.math.FloatingDecimal.parseFloat(FloatingDecimal.java:122)
at java.base/java.lang.Float.parseFloat(Float.java:455)
at org.apache.commons.lang.SystemUtils.getJavaVersionAsFloat(SystemUtils.java:1117)
at org.apache.commons.lang.SystemUtils.(SystemUtils.java:817)
... 23 more

@cadenkriese
Copy link

I'm getting the same issues on Java 11, @federkasten are you planning on supporting future java versions in this project?

@srdubya
Copy link

srdubya commented Dec 31, 2018

I got Java 11 working after looking at native/main.m. main.m assumes libjli.dylib is located in <jdk>/Contents/Home/jre/lib/jli/libjli.dylib, but there is no jre folder within the standard JDK-11.0.1 install. The following two manual tasks worked around the issue:

  1. One time: Created the path /Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home/jre/lib/jli and linked libjli.dylib into it.
  2. After each mvn package: Manually edit Info.plist, setting /Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk as the value for the key JVMRuntimePath. This can be done with defaults write <path>/Info.plist JVMRuntimePath /Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk

BTW, setting jrePath within pom.xml did not work. Attempting this yielded the following failure when executing mvn package. Rather than investigate this problem and take the size penalty for copying the JRE, I've opted to the above steps.

[ERROR] Failed to execute goal sh.tak.appbundler:appbundle-maven-plugin:1.2.0:bundle (default) on project <project>: Error copying folder /Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk to /Users/<user>/Documents/src/<project>/target/<project>-1.0-SNAPSHOT/<project>.app/Contents/PlugIns/JRE/Contents/Home/jre: Failed to copy full contents from /Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home/jre/lib/jli/libjli.dylib to /Users/<user>/Documents/src/<project>/target/<project>-1.0-SNAPSHOT/<project>.app/Contents/PlugIns/JRE/Contents/Home/jre/lib/jli/libjli.dylib -> [Help 1]

@xbiansf
Copy link

xbiansf commented Jan 18, 2019

Similar issue seen here. Hope to see the fix for this. Even I followed Srdubya's solution, I find the JavaAppLauncher will not work when you launch the Mac App. It will flash one second in the tray and crashes. I used the Mac utility console and dtruss to debug it, but found no useful info why if crashes. Interesting thing is if I open the content of the App and click the inside JavaAppLauncher, the app will launch and uses the openJdk 11 without problem.
The Jpackager for

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants