Page 1 of 2

java-related trouble getting Negatron started

Posted: Sun Feb 24, 2019 6:33 am
by iancharcoal
Hello,

I'm currently getting the following message when running Negatron.sh:

Error: Could not find or load main class net.babelsoft.negatron.NegatronApp
Caused by: java.lang.NoClassDefFoundError: javafx/application/Application

I have the following jfx packages installed:
libopenjfx-java 11.0.2+1-1
libopenjfx-jni 11.0.2+1-1
openjfx 11.0.2+1-1

When looking at my java installs with command "update-alternatives --config java" I have:
* 0 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 auto mode
1 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 manual mode
2 /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java 1081 manual mode

I'm using Debian.

I did have to use chmod to make Negatron.sh executable in the first place. Let me know if I can provide any further information.

Thanks,

Ian

Re: java-related trouble getting Negatron started

Posted: Sun Feb 24, 2019 3:01 pm
by BabelSoft
You have JavaFX 11 installed but Negatron is only compatible with Java and JavaFX 8. So, for now, you should install JavaFX 8 and edit Negatron.sh to force Negatron being launched with Java 8. Alternatively, you may change your default Java version to Java 8.

I need to make Negatron compatible with Java and JavaFX 11 because a lot of people are asking for this. This is the priority for the next version anyway.

Re: java-related trouble getting Negatron started

Posted: Sun Feb 24, 2019 4:50 pm
by iancharcoal
That makes sense, I will try that out later today and report back.

Re: java-related trouble getting Negatron started

Posted: Mon Feb 25, 2019 2:55 am
by iancharcoal
I have
-reverted my JavaFX 11 related packages down to 8:
libopenjfx-java 8u111-b14-1
libopenjfx-jni 8u111-b14-1
openjfx 8u111-b14-1
openjfx-source 8u111-b14-1

-removed my v11 java installs. All that appears to remain is:
java-8-openjdk-jre:amd64

At this point, the Negatron config window appeared for me when i ran Negatron.sh. The terminal appeared to show some errors while i clicked on the browse buttons and selected my mame install and extras location. Once I clicked 'OK' on the config window, the application broke on me. When I attempted to run Negatron.sh again I got the following error:
---------
net.babelsoft.negatron.NegatronApp start
SEVERE: Couldn't start Negatron
java.lang.IllegalStateException: Location is not set.
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2434)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2409)
at net.babelsoft.negatron.NegatronApp.start(NegatronApp.java:76)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$8(LauncherImpl.java:863)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$7(PlatformImpl.java:326)
at com.sun.javafx.application.PlatformImpl.lambda$null$5(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$6(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
at com.sun.glass.ui.gtk.GtkApplication.lambda$null$5(GtkApplication.java:139)
at java.lang.Thread.run(Thread.java:748)

Exception in Application start method
-----------

After this latest error, I attempted to install Oracle's Java version 8, so now I have the following packages installed:
oracle-java8-installer 8u201-1~webupd8~1
oracle-java8-set-default 8u201-1~webupd8~1

With this I was intending to circumvent the openjdk/javafx. I changed the default java from the Openjdk to Oracle's, reran Negatron.sh, and I received the same error as before.

I did some looking into the FXMLLoader and 'location not set' error, but most of the search results were geared towards java developers and their particular projects.

Re: java-related trouble getting Negatron started

Posted: Tue Feb 26, 2019 7:16 pm
by BabelSoft
This error is really weird.
The only reason this can happen is because some resources are missing, inaccessible or the Negatron.jar is corrupted in some ways.

Check that your account have read access right to all the files in the Negatron folder or simply force a chmod +777 temporarily for testing purposes.
Can you confirm that that you have those files (the strict minimum set of files needed to run Negatron):
- Negatron.jar
- lib/bcmail-jdk15on-152.jar
- lib/bcpg-jdk15on-152.jar
- lib/bcpkix-jdk15on-152.jar
- lib/bcprov-ext-jdk15on-152.jar
- lib/jna-4.2.2.jar
- lib/jna-platform-4.2.2.jar
- lib/Negatron-Preloader.jar
- lib/OpenViewerFX.jar
- lib/rhino-1.7.6.jar
- lib/slf4j-api-1.7.10.jar
- lib/stax-utils.jar
- lib/twelvemonkeys-common-image-3.4-SNAPSHOT.jar
- lib/twelvemonkeys-common-io-3.4-SNAPSHOT.jar
- lib/twelvemonkeys-common-lang-3.4-SNAPSHOT.jar
- lib/twelvemonkeys-imageio-bmp-3.4-SNAPSHOT.jar
- lib/twelvemonkeys-imageio-core-3.4-SNAPSHOT.jar
- lib/twelvemonkeys-imageio-metadata-3.4-SNAPSHOT.jar
- lib/vlcj-4.0.0-SNAPSHOT.jar
- theme/language/ui.properties
- theme/language/preload.properties

Re: java-related trouble getting Negatron started

Posted: Wed Feb 27, 2019 3:36 am
by iancharcoal
I verify that I have all of those files you listed.
I did the chmod 777 on the negatron folder located in /opt/
When i reran Negatron.sh, I got the same 'Location is not set' error from earlier.

I worried maybe there was something config-related lingering from downgrading openjavafx from 11 to 8. So I uninstalled openjavafx completely.
Before re-installing, I went ahead and reran Negatron.sh to verify I got a different error message. Interestingly enough, i got the same 'Location is not set' error message without having any openjavafx packages installed.

I went ahead and reinstalled the javafx version 8 packages anyways, and expectedly got the same error.

Re: java-related trouble getting Negatron started

Posted: Wed Feb 27, 2019 7:49 pm
by BabelSoft
It's really weird.
I suppose you installed the deb package. Can you try again with the cross-platform pack?

Re: java-related trouble getting Negatron started

Posted: Thu Feb 28, 2019 3:13 am
by iancharcoal
I uninstalled the .deb package and installed the cross-platform pack. The cross-platform opened without a problem and I was able to see the Negatron frontend.

Thanks for all your assistance. I'll be happy to test out any .deb packages that you may create for future releases. For now I just need to set some filepaths in Negamame and I should be good to go.

Re: java-related trouble getting Negatron started

Posted: Thu Feb 28, 2019 7:57 am
by BabelSoft
You're welcome :)
Well, actually I'm sorry about that. I should have tested this deb package all the way down to execution... I'll sure do it starting with the next version. Anyway, enjoy retrogaming!

Re: java-related trouble getting Negatron started

Posted: Fri Aug 23, 2019 10:35 am
by te_lanus
BabelSoft wrote: Sun Feb 24, 2019 3:01 pm I need to make Negatron compatible with Java and JavaFX 11 because a lot of people are asking for this. This is the priority for the next version anyway.
Any update on this?