Modify

Opened 13 months ago

Closed 13 months ago

Last modified 13 months ago

#23667 closed defect (invalid)

can't start josm-tested_19067 Error: A JNI error has occurred, please check your installation and try again

Reported by: anonymous Owned by: team
Priority: normal Milestone:
Component: Core Version: tested
Keywords: java8 startup Cc: taylor.smock

Description

Simply double clicking won't start josm-tested_1967. Older Joms-tested_17580 starts normally.
Kubuntu 22.04.4 LTS x86_64
Kernel: 5.15.0-94-generic

$ java -version
java version "1.8.0_241"
Java(TM) SE Runtime Environment (build 8.0.6.5 - pxa6480sr6fp5-20200111_02(SR6 FP5))
IBM J9 VM (build 2.9, JRE 1.8.0 Linux amd64-64-Bit Compressed References 20200108_436782 (JIT enabled, AOT enabled)
OpenJ9   - 7d1059c
OMR      - d059105
IBM      - c8aee39)
JCL - 20200110_01 based on Oracle jdk8u241-b07

If Run from terminal:

$ java -jar josm-tested.jar 
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: JVMCFRE003 bad major version; class=org/openstreetmap/josm/gui/MainApplication, offset=6
        at java.lang.ClassLoader.defineClassImpl(Native Method)
        at java.lang.ClassLoader.defineClassInternal(ClassLoader.java:398)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:359)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:154)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:730)
        at java.net.URLClassLoader.access$400(URLClassLoader.java:96)
        at java.net.URLClassLoader$ClassFinder.run(URLClassLoader.java:1187)
        at java.security.AccessController.doPrivileged(AccessController.java:770)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:605)
        at java.lang.ClassLoader.loadClassHelper(ClassLoader.java:944)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:889)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:872)
        at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:507)

Attachments (0)

Change History (9)

comment:1 by GerdP, 13 months ago

Resolution: invalid
Status: newclosed

JOSM now needs a Java runtime 11 or higher, it doesn't run with your JRE version 1.8.
Please install a newer Java version.

comment:2 by skyper, 13 months ago

Cc: taylor.smock added
Keywords: java8 startup added; Error Not Start Not Open Not Run don't run don't open removed
Resolution: invalid
Status: closedreopened

@anonymous: I do not know why you still need java version 8. Probably you should be fine with the openjdk-jre package provided by your distribution but I recommend to use our Ubuntu packages.

@Taylor: I thought there should be a message for the user providing some info if JOSM is started with a java version below 11.

comment:3 by taylor.smock, 13 months ago

I thought there should be a message for the user providing some info if JOSM is started with a java version below 11.

There was, for a month or so (and the code is still there). The problem is that we are now compiling for Java 11 (as of r19044), which means Java 8 users cannot even start JOSM.

The warning was there to give people a chance to move off of Java 8 while we could still give them some instructions. I did look into compiling some parts of JOSM with Java 8 so that we wouldn't have this particular issue, but it turned out I would have had to compile almost everything for Java 8 if we went that route.

Anyway, it sounds like this specific user hadn't updated in years, and when they did update, they weren't able to start JOSM. I don't think there is anything we could have done for this specific user.

The next time we move Java versions, I'll try to remember to make the Java update dialog appear more persistently a year or so out, but I don't think that would have helped in this case.

comment:4 by anonymous, 13 months ago

I'v tried open with > java 11 too, same problem. java 11 is installed and showing in open with context menu, ot select from *.jar file properties. Still same. Or is there any other way to do that?

comment:5 by skyper, 13 months ago

Resolution: invalid
Status: reopenedclosed

Ok, thanks for the info. Yes, 6-12 month is probably better. One month is simply a waste of developers' time as users are slow in updating and might not even see the message if they do not update every month.

in reply to:  4 comment:6 by skyper, 13 months ago

Replying to anonymous:

I'v tried open with > java 11 too, same problem. java 11 is installed and showing in open with context menu, ot select from *.jar file properties. Still same. Or is there any other way to do that?

Do you still need java 8? If not I would uninstall it. Anyway, you can try to directly use openjdk-11-jre:

/usr/lib/jvm/java-11-openjdk-amd64/bin/java -jar josm-tested.jar

but as written above, I recommend the Ubuntu packages as you need quite some JVM options which are included in the start script provided by the packages.

Edit: add missing -jar

Last edited 13 months ago by skyper (previous) (diff)

comment:7 by anonymous, 13 months ago

I try to keep the latest updated things, may be there is somryhing which needs this java-8, thats why I may be kept this, can't remember now.

I found this:

ls -l /usr/lib/jvm/
total 12
lrwxrwxrwx 1 root root   25 ফেব      20  2019 default-java -> java-1.11.0-openjdk-amd64
lrwxrwxrwx 1 root root   18 ফেব      11  2020 ibm-java80-jre-x86_64 -> java-ibm-x86_64-80
lrwxrwxrwx 1 root root   21 জানু      15  2020 java-1.11.0-openjdk-amd64 -> java-11-openjdk-amd64
lrwxrwxrwx 1 root root   20 অক্টোবর   28  2017 java-1.8.0-openjdk-amd64 -> java-8-openjdk-amd64
drwxr-xr-x 9 root root 4096 এপ্রিল    17 02:50 java-11-openjdk-amd64
drwxr-xr-x 5 root root 4096 এপ্রিল    18  2019 java-8-openjdk-amd64
drwxr-xr-x 5 root root 4096 জুন       23  2020 java-ibm-x86_64-80

trying to make the default-java pointing to 11

/usr/lib/jvm/java-11-openjdk-amd64/bin/java josm-tested.jar
Error: Could not find or load main class josm-tested.jar
Caused by: java.lang.ClassNotFoundException: josm-tested.jar

I like standalone apps, jars, but if still I fail, I may consider this by [Ubuntu Packages](https://josm.openstreetmap.de/wiki/Download#Ubuntu).

comment:8 by taylor.smock, 13 months ago

For your (@anonymous) last issue, /usr/lib/jvm/java-11-openjdk-amd64/bin/java -jar josm-tested.jar should work (notice the added -jar).

@skyper:
I think 1 month is a bit short as well; I originally intended to keep compiling JOSM for Java 8 for 3-4 months (at least), specifically to avoid getting issues like this.

I just implemented the functionality on the tail end of the migration. Which wasn't ideal.

comment:9 by anonymous, 13 months ago

/usr/lib/jvm/java-11-openjdk-amd64/bin/java -jar josm-tested.jar

Yes it works. missed the -jar. Thank you

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.