Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnsupportedClassVersionError: SwaggerBrakeMain has been compiled by a more recent version #121

Closed
fairking opened this issue Nov 28, 2023 · 3 comments
Labels

Comments

@fairking
Copy link

fairking commented Nov 28, 2023

I could not execute the recent version of swagger-brake-2.4.0-cli.jar on windows.
I tried to go to https://www.java.com/download/ie_manual.jsp and download and install the recent Java runtime, but the error persists. Tried to restart the PC. No chance.

I am running the following command:

java -jar "..\..\Utils\SwaggerBrake\swagger-brake-2.3.0-cli.jar" --old-api=schema_old_live.json --new-api=schema.json --output-formats=HTML --output-path=.\

Exception in thread "main" java.lang.UnsupportedClassVersionError: io/redskap/swagger/brake/cli/SwaggerBrakeMain 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 52.0
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(Unknown Source)
        at java.security.SecureClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.access$100(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)

My java version is:

C:\Users\Admin>java -version
java version "1.8.0_391"
Java(TM) SE Runtime Environment (build 1.8.0_391-b13)
Java HotSpot(TM) Client VM (build 25.391-b13, mixed mode, sharing)

C:\Users\Admin>

image

Is there anything else needs to be done in order to fix it?

@galovics
Copy link
Member

hi @fairking.

There's been an upgrade from JDK8 to JDK17 recently. Please give it a try with that.

@fairking
Copy link
Author

fairking commented Nov 29, 2023

hi @fairking.

There's been an upgrade from JDK8 to JDK17 recently. Please give it a try with that.

Ok, thanks for the reply. Looks like it's a separate Dev Kit, not a runtime. And it's proprietary software. I don't think I am going to use it. (https://www.oracle.com/java/technologies/downloads/#jdk17-windows). Things become over-complicated.

@galovics
Copy link
Member

@fairking

Using newer Oracle JDKs could be a pain in the butt for sure with the changed licensing structure.

I'd say you should use either OpenJDK distributions or go straight with Amazon Corretto. I mostly use the latter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants