SporeModder-FX icon indicating copy to clipboard operation
SporeModder-FX copied to clipboard

macOS Support

Open arthrfrts opened this issue 5 years ago • 11 comments

Hi!

I love your work on SporeModder, and I wonder if you could release a macOS version of it? I've tried to execute the .jar file or bundle it in a macOS app, but none of this worked. Maybe JDK can offer a simple way to bundle this project as an macOS app?

Thanks!

arthrfrts avatar Mar 10 '19 03:03 arthrfrts

Open the Terminal in macOS and navigate to the SporeModder FX folder. There, execute this line: java -jar SporeModderFX.jar Show me a picture of what appears in the terminal.

emd4600 avatar Mar 10 '19 08:03 emd4600

It returns the following:

Exception in thread "main" java.lang.NoClassDefFoundError: javafx/application/Application
	at java.base/java.lang.ClassLoader.defineClass1(Native Method)
	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
	at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
	at java.base/java.net.URLClassLoader.defineClass(URLClassLoader.java:550)
	at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:458)
	at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:452)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:451)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Class.java:398)
	at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:56)
Caused by: java.lang.ClassNotFoundException: javafx.application.Application
	at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:471)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
	... 13 more

arthrfrts avatar Mar 10 '19 18:03 arthrfrts

Type java -version in the terminal and tell me what shows there. SMFX requires Java 8 to run

emd4600 avatar Mar 10 '19 18:03 emd4600

I'm getting this:

java 11.0.2 2019-01-15 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.2+9-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.2+9-LTS, mixed mode)

If needed, I can try to download a different version via Homebrew.

arthrfrts avatar Mar 10 '19 19:03 arthrfrts

Yes, I think you'll have to install Java 8. You can download it here: https://www.java.com/en/download/

emd4600 avatar Mar 10 '19 19:03 emd4600

Ok, using Java 8 it actually opens, but before something happens it crashes. The Terminal log follows:

java.lang.NoSuchMethodException: java.util.prefs.MacOSXPreferences.WindowsRegOpenKey(int, [B, int)
	at java.lang.Class.getDeclaredMethod(Class.java:2130)
	at sporemodder.util.WinRegistry.<clinit>(WinRegistry.java:68)
	at sporemodder.GameManager.getRegistryValue(GameManager.java:374)
	at sporemodder.GameManager.getFromRegistry(GameManager.java:352)
	at sporemodder.GameManager.getFromRegistry(GameManager.java:384)
	at sporemodder.GameManager.autoDetectPaths(GameManager.java:212)
	at sporemodder.GameManager.initialize(GameManager.java:162)
	at sporemodder.MainApp.init(MainApp.java:186)
	at sporemodder.MainApp.init(MainApp.java:223)
	at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:841)
	at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$159(LauncherImpl.java:182)
	at java.lang.Thread.run(Thread.java:748)
java.lang.NullPointerException
	at sporemodder.util.WinRegistry.valueForKey(WinRegistry.java:256)
	at sporemodder.util.WinRegistry.valueForKey(WinRegistry.java:108)
	at sporemodder.file.shaders.FXCompiler.autoDetectPath(FXCompiler.java:47)
	at sporemodder.file.shaders.FXCompiler.initialize(FXCompiler.java:33)
	at sporemodder.MainApp.init(MainApp.java:195)
	at sporemodder.MainApp.init(MainApp.java:223)
	at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:841)
	at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$159(LauncherImpl.java:182)
	at java.lang.Thread.run(Thread.java:748)
mar 10, 2019 5:32:30 PM javafx.fxml.FXMLLoader$ValueElement processValue
ADVERTÊNCIA: Loading FXML document with JavaFX API of version 9.0.1 by JavaFX runtime of version 8.0.202
mar 10, 2019 5:32:31 PM javafx.fxml.FXMLLoader$ValueElement processValue
ADVERTÊNCIA: Loading FXML document with JavaFX API of version 9.0.1 by JavaFX runtime of version 8.0.202
mar 10, 2019 5:32:31 PM javafx.fxml.FXMLLoader$ValueElement processValue
ADVERTÊNCIA: Loading FXML document with JavaFX API of version 9.0.1 by JavaFX runtime of version 8.0.202
mar 10, 2019 5:32:31 PM javafx.fxml.FXMLLoader$ValueElement processValue
ADVERTÊNCIA: Loading FXML document with JavaFX API of version 9.0.1 by JavaFX runtime of version 8.0.202
mar 10, 2019 5:32:31 PM javafx.fxml.FXMLLoader$ValueElement processValue
ADVERTÊNCIA: Loading FXML document with JavaFX API of version 9.0.1 by JavaFX runtime of version 8.0.202
mar 10, 2019 5:32:31 PM javafx.fxml.FXMLLoader$ValueElement processValue
ADVERTÊNCIA: Loading FXML document with JavaFX API of version 9.0.1 by JavaFX runtime of version 8.0.202
mar 10, 2019 5:32:31 PM javafx.fxml.FXMLLoader$ValueElement processValue
ADVERTÊNCIA: Loading FXML document with JavaFX API of version 9.0.1 by JavaFX runtime of version 8.0.202
mar 10, 2019 5:32:31 PM javafx.fxml.FXMLLoader$ValueElement processValue
ADVERTÊNCIA: Loading FXML document with JavaFX API of version 9.0.1 by JavaFX runtime of version 8.0.202
mar 10, 2019 5:32:31 PM javafx.fxml.FXMLLoader$ValueElement processValue
ADVERTÊNCIA: Loading FXML document with JavaFX API of version 9.0.1 by JavaFX runtime of version 8.0.202
mar 10, 2019 5:32:31 PM javafx.fxml.FXMLLoader$ValueElement processValue
ADVERTÊNCIA: Loading FXML document with JavaFX API of version 9.0.1 by JavaFX runtime of version 8.0.202
mar 10, 2019 5:32:31 PM javafx.fxml.FXMLLoader$ValueElement processValue
ADVERTÊNCIA: Loading FXML document with JavaFX API of version 9.0.1 by JavaFX runtime of version 8.0.202
mar 10, 2019 5:32:31 PM com.sun.javafx.css.StyleManager loadStylesheetUnPrivileged
INFORMAÇÕES: Could not find stylesheet: file:/Users/arthr/Downloads/sporemodder_fx/Styles%5CDefault%5Cribbonstyle.css
mar 10, 2019 5:32:31 PM com.sun.javafx.css.StyleManager loadStylesheetUnPrivileged
INFORMAÇÕES: Could not find stylesheet: file:/Users/arthr/Downloads/sporemodder_fx/Styles%5CDefault%5Cbasic.css
mar 10, 2019 5:32:31 PM com.sun.javafx.css.StyleManager loadStylesheetUnPrivileged
INFORMAÇÕES: Could not find stylesheet: file:/Users/arthr/Downloads/sporemodder_fx/Styles%5CDefault%5Csyntax.css
java.io.FileNotFoundException: /Users/arthr/Downloads/sporemodder_fx/Styles\Default\ribbon-expand.png (No such file or directory)
	at java.io.FileInputStream.open0(Native Method)
	at java.io.FileInputStream.open(FileInputStream.java:195)
	at java.io.FileInputStream.<init>(FileInputStream.java:138)
	at sporemodder.view.UserInterface.getResource(UserInterface.java:82)
	at emord.javafx.ribbon.skin.RibbonSkin.construct(RibbonSkin.java:139)
	at emord.javafx.ribbon.skin.RibbonSkin.<init>(RibbonSkin.java:71)
	at emord.javafx.ribbon.Ribbon.createDefaultSkin(Ribbon.java:426)
	at javafx.scene.control.Control.impl_processCSS(Control.java:872)
	at javafx.scene.Parent.impl_processCSS(Parent.java:1280)
	at javafx.scene.Parent.impl_processCSS(Parent.java:1280)
	at javafx.scene.Node.processCSS(Node.java:9056)
	at javafx.scene.Scene.doCSSPass(Scene.java:545)
	at javafx.scene.Scene.preferredSize(Scene.java:1643)
	at javafx.scene.Scene.impl_preferredSize(Scene.java:1720)
	at javafx.stage.Window$9.invalidated(Window.java:864)
	at javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:109)
	at javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:144)
	at javafx.stage.Window.setShowing(Window.java:940)
	at javafx.stage.Window.show(Window.java:955)
	at javafx.stage.Stage.show(Stage.java:259)
	at sporemodder.UIManager.show(UIManager.java:180)
	at sporemodder.MainApp.start(MainApp.java:252)
	at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$166(LauncherImpl.java:863)
	at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$179(PlatformImpl.java:326)
	at com.sun.javafx.application.PlatformImpl.lambda$null$177(PlatformImpl.java:295)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.sun.javafx.application.PlatformImpl.lambda$runLater$178(PlatformImpl.java:294)
	at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
Exception in Application start method
Exception in thread "main" java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Caused by: java.lang.RuntimeException: Exception in Application start method
	at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:917)
	at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$159(LauncherImpl.java:182)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException: Input stream must not be null
	at javafx.scene.image.Image.validateInputStream(Image.java:1128)
	at javafx.scene.image.Image.<init>(Image.java:706)
	at emord.javafx.ribbon.skin.RibbonSkin.construct(RibbonSkin.java:139)
	at emord.javafx.ribbon.skin.RibbonSkin.<init>(RibbonSkin.java:71)
	at emord.javafx.ribbon.Ribbon.createDefaultSkin(Ribbon.java:426)
	at javafx.scene.control.Control.impl_processCSS(Control.java:872)
	at javafx.scene.Parent.impl_processCSS(Parent.java:1280)
	at javafx.scene.Parent.impl_processCSS(Parent.java:1280)
	at javafx.scene.Node.processCSS(Node.java:9056)
	at javafx.scene.Scene.doCSSPass(Scene.java:545)
	at javafx.scene.Scene.preferredSize(Scene.java:1643)
	at javafx.scene.Scene.impl_preferredSize(Scene.java:1720)
	at javafx.stage.Window$9.invalidated(Window.java:864)
	at javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:109)
	at javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:144)
	at javafx.stage.Window.setShowing(Window.java:940)
	at javafx.stage.Window.show(Window.java:955)
	at javafx.stage.Stage.show(Stage.java:259)
	at sporemodder.UIManager.show(UIManager.java:180)
	at sporemodder.MainApp.start(MainApp.java:252)
	at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$166(LauncherImpl.java:863)
	at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$179(PlatformImpl.java:326)
	at com.sun.javafx.application.PlatformImpl.lambda$null$177(PlatformImpl.java:295)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.sun.javafx.application.PlatformImpl.lambda$runLater$178(PlatformImpl.java:294)
	at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)

I think it's one of these two warnings:

  • Loading FXML document with JavaFX API of version 9.0.1 by JavaFX runtime of version 8.0.202
  • java.io.FileNotFoundException: /Users/arthr/Downloads/sporemodder_fx/Styles\Default\ribbon-expand.png

The non-FX version of SporeModder opens with the java -jar <exec> command!

arthrfrts avatar Mar 10 '19 20:03 arthrfrts

Could you check if there is a file called ribbon-expand.png inside the Styles/Default folder?

emd4600 avatar Mar 10 '19 22:03 emd4600

Yeah, there is.

Captura de Tela 2019-03-10 às 22 13 27

arthrfrts avatar Mar 11 '19 01:03 arthrfrts

Sorry for taking so much time to answer. Try replacing SporeModderFX.jar with the following file. If it still does not work, open it with the terminal like you did previously and post the error here.

https://www.mediafire.com/file/dfz2wr0581gbg28/SporeModderFX.jar/file

emd4600 avatar Mar 21 '19 23:03 emd4600

It only returns that it wasn't possible to find the main jar class.

arthrfrts avatar Mar 23 '19 03:03 arthrfrts

I believe it should be working now, but I can't test it.

emd4600 avatar Sep 20 '22 16:09 emd4600