HanSolo / SpaceFX

Just a simple tiny space game written in JavaFX
Apache License 2.0
165 stars 33 forks source link

Starting SpaceFX with `./gradlew run` fails on OSX 10.14.6 with OpenJDK 12 #3

Closed Oliver-Loeffler closed 4 years ago

Oliver-Loeffler commented 4 years ago

Playing around with SpaceFX I found, that SpaceFX won't start from command using ./gradlew run.

Following error message was given:

> Task :run
No module was provided for main class, assuming the current module. Prefer providing 'mainClassName' in the following format: '$moduleName/a.b.Main'
Exception in Application init method
java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:567)
        at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:464)
        at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:363)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:567)
        at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:1051)
Caused by: java.lang.RuntimeException: Exception in Application init method
        at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:895)
        at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195)
        at java.base/java.lang.Thread.run(Thread.java:835)
Caused by: java.lang.ExceptionInInitializerError
        at spacefx/eu.hansolo.spacefx.SpaceFX.init(SpaceFX.java:271)
        at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:824)
        ... 2 more
Caused by: java.lang.NullPointerException
        at spacefx/eu.hansolo.spacefx.PropertyManager.storeProperties(PropertyManager.java:71)
        at spacefx/eu.hansolo.spacefx.PropertyManager.createProperties(PropertyManager.java:105)
        at spacefx/eu.hansolo.spacefx.PropertyManager.readProperties(PropertyManager.java:94)
        at spacefx/eu.hansolo.spacefx.PropertyManager.<init>(PropertyManager.java:38)
        at spacefx/eu.hansolo.spacefx.PropertyManager.<clinit>(PropertyManager.java:31)
        ... 4 more
Exception running application eu.hansolo.spacefx.SpaceFX

Looks like something in the spacefx/eu.hansolo.spacefx.PropertyManager.

HanSolo commented 4 years ago

I've made some modifications lately, can you pull the latest one from master and try again please...?

Oliver-Loeffler commented 4 years ago

You've been too fast 👍 ... was just preparing a pull request. But yes, it works now!