PCGen / pcgen

Main code and data development for pcgen program release
http://pcgen.org
GNU Lesser General Public License v2.1
431 stars 341 forks source link

Hang at Initialize UI #4038

Closed 4restM closed 6 years ago

4restM commented 6 years ago

Heya folks. Having some issues running the application on mac. It is currently hanging after open .jar file. Have tried multiple versions, 6.06.1 & 6.07.7 & 6.07.8. Have also reinstalled java JRE and JDK multiple times and restarted.

My java log is as follows.

21:33:17.733 INFO main Main:140 Starting PCGen v6.07.08 21:33:17.875 INFO main LanguageBundle:134 Initialising language bundle with locale en_US. 21:33:34.341 SEVERE main Main:544 Uncaught error - ignoring java.lang.NoClassDefFoundError: com/apple/eawt/AboutHandler at pcgen.gui2.PCGenUIManager.initializeGUI(PCGenUIManager.java:52) at pcgen.system.Main.startupWithGUI(Main.java:258) at pcgen.system.Main.main(Main.java:161) Caused by: java.lang.ClassNotFoundException: com.apple.eawt.AboutHandler 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) ... 3 more

4restM commented 6 years ago

To clarify it hangs at initializing UI

kktripp commented 6 years ago

I have this same issue.

sharatg commented 6 years ago

I also have this issue. Perhaps related to having newer versions of the JDK.

coyoteconscious commented 6 years ago

I have a fresh install, with a brand-new install of JDK 10. Hangs at "Initializing UI".

If there is a specific version that this is know to work with (or not work with), is that documented anywhere? The only note I see in the installation instructions looks very out of date, and says "you need at least this version..." If it only works with legacy Java, that would be good to know. : )

sharatg commented 6 years ago

i have an old version of this running on legacy Java on an old mac.

PCGen 6.03.06 Java 7 version 67 (build 1.7.0_67-b01)

coyoteconscious commented 6 years ago

After removing all of JDK 10 (googled it), I installed Java 8 Update 181 and that seems to work.

Might want to add a note in the documentation about which Java works.

jcstier commented 6 years ago

I found this problem with Java 10 on Mac. Simple change in PCGenUIManager got me passed

java.lang.NoClassDefFoundError: com/apple/eawt/AboutHandler
    at pcgen.gui2.PCGenUIManager.initializeGUI(PCGenUIManager.java:58)
    at pcgen.system.Main.startupWithGUI(Main.java:255)
    at pcgen.system.Main.main(Main.java:157)
Caused by: java.lang.ClassNotFoundException: com.apple.eawt.AboutHandler
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:190)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499)
    ... 3 more

The line

// Don't start macOS GUI if we're on Java 9 since it doesn't work.
if (SystemUtils.IS_OS_MAC_OSX && (System.getProperty("java.runtime.version").charAt(0) != '9'))

Wouldn't handle newer versions of Java beyond java 9... This fixes it..

// Don't start macOS GUI if we're on Java 9 or later since it won't work.
if (SystemUtils.IS_OS_MAC_OSX &&
    (Integer.valueOf(System.getProperty("java.runtime.version").split("\\.")[0]) < 9))
{

And will account for newer versions of java until the MacGUIHandler can be removed or updated.
Can some one add this to master? Or would you like me to PR?

Just started playing Pathfinder and PCGen saves sooooo much time. :) I dig it!

Zaister commented 6 years ago

This is already handled in PR https://github.com/PCGen/pcgen/pull/4169#pullrequestreview-147165055 that will fix the MacGUIHandler.

karianna commented 6 years ago

PR landed