Bug - Not A Bug Can't open .jar on Ubuntu 22.04

Southwest

New member
I have already read the stickied thread about being unable to open the KoLmafia jar file, but it has not helped me.

I'm attempting to run KoLmafia from my Ubuntu desktop, but when I attempt to open the .jar file, I get an error:

Code:
$ java -jar kolmafia.jar
Error: LinkageError occurred while loading main class net.sourceforge.kolmafia.KoLmafia
    java.lang.UnsupportedClassVersionError: net/sourceforge/kolmafia/KoLmafia has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0

This is the result of java -version:
Code:
$ java -version
openjdk version "11.0.21" 2023-10-17
OpenJDK Runtime Environment (build 11.0.21+9-post-Ubuntu-0ubuntu122.04)
OpenJDK 64-Bit Server VM (build 11.0.21+9-post-Ubuntu-0ubuntu122.04, mixed mode, sharing)

And here's the result of javac -version:
Code:
$ javac -version
javac 11.0.21

I recognize this is not a KoLmafia bug per se, but I'm hoping you fine folks won't mind pointing me in the right direction regardless. How do I get a version of the Java Runtime that recognizes a class file version 61.0, so I can open KoLmafia?

Many thanks in advance.
 

fronobulax

Developer
Staff member
Thank you for the report, in that it told me everything I might have asked.

What concerns me is that your versions are being reported as 11. KoLmafia requires 17. So the failure is "behaving as expected".

If you click on the RECOMMENDED JAVA at the top of the KoLmafia.us main page you will eventually get to


My first step would be to pick the appropriate architecture and then download and install.

If you think you have done that or used a package manager and done something similar you might check to see if there are multiple versions of Java on your system. You may then need to remove one or adjust your PATH so the right one comes first. The which command can be helpful.
 
Top