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

[Mac] Error when launching with Java 9 or 10 #38

Closed
tofi86 opened this issue Jun 11, 2017 · 3 comments · Fixed by #43
Closed

[Mac] Error when launching with Java 9 or 10 #38

tofi86 opened this issue Jun 11, 2017 · 3 comments · Fixed by #43
Assignees
Labels
Milestone

Comments

@tofi86
Copy link
Collaborator

tofi86 commented Jun 11, 2017

Java 9-ea seems to have problems with JNI methods:

Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.NoClassDefFoundError: com/apple/eawt/QuitHandler
	at java.base/java.lang.Class.getDeclaredMethods0(Native Method)
	at java.base/java.lang.Class.privateGetDeclaredMethods(Unknown Source)
	at java.base/java.lang.Class.getMethodsRecursive(Unknown Source)
	at java.base/java.lang.Class.getMethod0(Unknown Source)
	at java.base/java.lang.Class.getMethod(Unknown Source)
	at java.base/sun.launcher.LauncherHelper.validateMainClass(Unknown Source)
	at java.base/sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
Caused by: java.lang.ClassNotFoundException: com.apple.eawt.QuitHandler
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
	at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
	... 7 more

Tested with new universalJavaApplicationStub with Java 9 support (tofi86/universalJavaApplicationStub#43).

However, com/apple/eawt/QuitHandler class is part of the EPUB-Checker-JAR...

@tofi86 tofi86 added the bug label Jun 11, 2017
@tofi86 tofi86 added this to the Next milestone Jun 11, 2017
@tofi86 tofi86 self-assigned this Jun 11, 2017
@tofi86
Copy link
Collaborator Author

tofi86 commented Feb 18, 2018

(refs liamsharp/universalJavaApplicationStubDemo#2)

The apple specific event handlers do not work with Java 9 anymore because Java 9 deprecated/removed the classes from package com.apple.eawt.*. See the following links for details:

People came up with workarounds, like Reflection:

@tofi86 tofi86 changed the title [Mac] Error when launching with Java 9 [Mac] Error when launching with Java 9 or 10 May 28, 2018
tofi86 added a commit that referenced this issue May 28, 2018
@tofi86
Copy link
Collaborator Author

tofi86 commented May 28, 2018

The Mac launcher script can work with Java 9, the Windows launcher not yet. However:

Launch4j 3.12 was released with support for Java 9 and 10: http://launch4j.sourceforge.net/changelog.html

Waiting for an update of the maven launch4j plugin orphan-oss/launch4j-maven-plugin#75 and then we can try again.

@tofi86
Copy link
Collaborator Author

tofi86 commented Jul 26, 2018

Windows launcher supports Java 9 and 10 now, works as expected.

tofi86 pushed a commit that referenced this issue Jul 30, 2018
@tofi86 tofi86 closed this as completed in 63d76ce Jul 30, 2018
tofi86 pushed a commit that referenced this issue Jul 30, 2018
Matches Java Versions 1.7, 1.8, 9, 10, 11, …

refs #38
tofi86 pushed a commit that referenced this issue Jul 30, 2018
Matches Java Versions 1.7, 1.8, 9, 10, 11, …

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

Successfully merging a pull request may close this issue.

1 participant