Another Linux starting issue

Here's the place to discuss anything about Negatron or MAME in English.
MarcoBi
Posts: 7
Joined: Wed Sep 11, 2019 5:34 pm

Another Linux starting issue

Post by MarcoBi »

Hi,

on my ArchLinux box I actually have a starting issue with Negatron:

with openjdk version 1.8.0 and openjfx 8, I always get an error while trying to start Negatron.sh:

Code: Select all

[marco@Port371]: /var/tmp/Negatron>$ ./Negatron.sh
Exception in Preloader start method
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 com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:389)
	at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)
	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 sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:767)
Caused by: java.lang.RuntimeException: Exception in Preloader start method
	at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:899)
	at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$1(LauncherImpl.java:182)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NumberFormatException: For input string: "202-ea"
	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
	at java.lang.Integer.parseInt(Integer.java:580)
	at java.lang.Integer.parseInt(Integer.java:615)
	at net.babelsoft.negatron.preloader.NegatronPreloader.start(Unknown Source)
	at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$6(LauncherImpl.java:785)
	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$10(GtkApplication.java:245)
	... 1 more
	Exception running application net.babelsoft.negatron.NegatronApp
BabelSoft
Site Admin
Posts: 342
Joined: Sat Jun 02, 2012 9:23 pm

Re: Another Linux starting issue

Post by BabelSoft »

This is because you launch Negatron with an old and early access version of Java.

Negatron.sh always launches Negatron with the default configured Java by using the environment variable $JAVA. And here Negatron is getting this Java version: 202-ea. Here "ea" stands for early version and this is probably Java 1.2.02 beta version.

If you know how to change the Java executable $JAVA is pointing to, simply change it for your openjdk 1.8.0. Another way is to edit Negatron.sh to replace $JAVA with the actual path to your openjdk executable.
MarcoBi
Posts: 7
Joined: Wed Sep 11, 2019 5:34 pm

Re: Another Linux starting issue

Post by MarcoBi »

BabelSoft wrote: Wed Sep 11, 2019 6:16 pm This is because you launch Negatron with an old and early access version of Java.

Negatron.sh always launches Negatron with the default configured Java by using the environment variable $JAVA. And here Negatron is getting this Java version: 202-ea. Here "ea" stands for early version and this is probably Java 1.2.02 beta version.

If you know how to change the Java executable $JAVA is pointing to, simply change it for your openjdk 1.8.0. Another way is to edit Negatron.sh to replace $JAVA with the actual path to your openjdk executable.
I agree but:

Code: Select all

[marco@Port371]: /var/tmp/Negatron>$ /usr/bin/java -version
openjdk version "1.8.0_222"
OpenJDK Runtime Environment (build 1.8.0_222-b05)
OpenJDK 64-Bit Server VM (build 25.222-b05, mixed mode)
so I begin to think to have a broken system somehow....
BabelSoft
Site Admin
Posts: 342
Joined: Sat Jun 02, 2012 9:23 pm

Re: Another Linux starting issue

Post by BabelSoft »

try with this command:

Code: Select all

$JAVA -version
I bet it'll return something else entirely.
MarcoBi
Posts: 7
Joined: Wed Sep 11, 2019 5:34 pm

Re: Another Linux starting issue

Post by MarcoBi »

BabelSoft wrote: Wed Sep 11, 2019 8:07 pm try with this command:

Code: Select all

$JAVA -version
I bet it'll return something else entirely.
$JAVA is unset by default on ArchLinux so

Code: Select all

$JAVA -version
fails.

At this point with:

Code: Select all

[marco@Port371]: /var/tmp/Negatron>$ /usr/bin/java -version
openjdk version "1.8.0_222"
OpenJDK Runtime Environment (build 1.8.0_222-b05)
OpenJDK 64-Bit Server VM (build 25.222-b05, mixed mode)
the command:

Code: Select all

/usr/bin/java -Xms512m -Xmx2g -jar Negatron.jar
gives me the previuos error.

ps
202 seems to be OpenJFX version mumber:

Code: Select all

[marco@Port371]: /var/tmp/Negatron>$ pacman -Q | grep jfx
java8-openjfx 8.u202-3
BabelSoft
Site Admin
Posts: 342
Joined: Sat Jun 02, 2012 9:23 pm

Re: Another Linux starting issue

Post by BabelSoft »

It looks like Negatron is crashing when parsing the JavaFX version, not the JDK version.
Can you check and see which JavaFX versions are installed on your system?

Edit: oops, I didn't read the last lines of your last post.
Yes, it's probably because of your JavaFX version. Can you try to see if there's an updated version of JavaFX for your distro?
MarcoBi
Posts: 7
Joined: Wed Sep 11, 2019 5:34 pm

Re: Another Linux starting issue

Post by MarcoBi »

BabelSoft wrote: Wed Sep 11, 2019 8:35 pm It looks like Negatron is crashing when parsing the JavaFX version, not the JDK version.
Can you check and see which JavaFX versions are installed on your system?

Edit: oops, I didn't read the last lines of your last post.
Yes, it's probably because of your JavaFX version. Can you try to see if there's an updated version of JavaFX for your distro?
Package is the latest and it's built from https://hg.openjdk.java.net/openjfx/8u/ ... ga.tar.bz2 , I'll try to setup a vm with an ubuntu distro just to test this environment. ty very much for the moment.
BabelSoft
Site Admin
Posts: 342
Joined: Sat Jun 02, 2012 9:23 pm

Re: Another Linux starting issue

Post by BabelSoft »

I don't have the time to do it now but, over the weekend, I'll draft a quick Java exec to see exactly what are the JDK and JavaFX versions that Java applications can see on your machine.
If 1.8.202-ea is indeed the only version string that Java applications can retrieve. I'll then patch Negatron so that it can properly handle beta versions.
MarcoBi
Posts: 7
Joined: Wed Sep 11, 2019 5:34 pm

Re: Another Linux starting issue

Post by MarcoBi »

BabelSoft wrote: Wed Sep 11, 2019 9:12 pm I don't have the time to do it now but, over the weekend, I'll draft a quick Java exec to see exactly what are the JDK and JavaFX versions that Java applications can see on your machine.
If 1.8.202-ea is indeed the only version string that Java applications can retrieve. I'll then patch Negatron so that it can properly handle beta versions.
I'll happily check it!
BabelSoft
Site Admin
Posts: 342
Joined: Sat Jun 02, 2012 9:23 pm

Re: Another Linux starting issue

Post by BabelSoft »

Can you download the Java exec from here and run it with the below command?

Code: Select all

java -jar JavaFXStringVersion.jar
It should open a window with a message giving 3 different version strings. Please, report them here afterwards.
Post Reply