1

I am trying to run a java file using the command

java -jar BlueMap-3.14-cli.jar

but that leads to an error

Exception in thread "main" java.lang.UnsupportedClassVersionError: de/bluecolored/bluemap/cli/BlueMapCLI has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:756)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:473)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
    at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:620)

I am using MacOS 13.4 (22F66) and java -version says java version "1.8.0_371".

I am NOT an java expert and assume I have to update java? How to do that in the MOST SIMPLE POSSIBLE way, ideally using only command line commands?

1 Answer 1

4

Yes, you need to install a more recent version of Java - Java 11 or later.

How to install Java 17

It's easiest to use Homebrew, a package manager for MacOS, to install packages on MacOS:

brew install openjdk@17

This requires Homebrew to be installed first. You can find the instructions here: brew.sh

What Java version to install

To be specific, class file version 55 refers to Java 11. That's the minimum version you have to install. However, I recommend to install the latest long term support version that is Java 17 currently.

If you are interested, you can find a table combining the class file versions with Java versions in Chapter 4 "the class file format" in the official documentation.

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.