"class file versions" error
I have the error Exception in thread "main" java.lang.UnsupportedClassVersionError: com/rarchives/ripme/App 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
I understand that I have to install the last version of the JRE so I perform the following step :
- I remove all java installed versions (with the uninstaller Java tool)
- Restart my computer
- Reinstall last version of the JRE (Version 8 Update 451) from here https://www.java.com/fr/download/
- Execute
$>java -jar ripme-2.1.18-16-1342b621.jar
I still have the same error...
The version of Java is :
$>java -version java version "1.8.0_451" Java(TM) SE Runtime Environment (build 1.8.0_451-b10) Java HotSpot(TM) Client VM (build 25.451-b10, mixed mode, sharing)
Can someone tell me how to get rid of this error ?
Thanks in advance for your help.
In addition I had to resintall windows completly. So even on a fresh windows 11 install, it still doesn't work. I'm sure I'm missing something obvious, but I really don't see it...
Hi @henkin67 Based on error mentioned you need to use at least java 17 to run the jar. You can find class file version and runtime version mapping here
Hi @Praphul00 ,
Thanks for your answers. I clearly understand that I need to install a newer version of java.
But I'm using the installer provided here : https://www.java.com/fr/download/ So if it's not the proper place to install the install version of java, where and how can I install it?
Hi @henkin67, You can download latest java from oracle website.
Hi @henkin67 ,
The error indicates that the application was compiled with Java 17 or higher, but your system runs Java 8, which is outdated for this jar. To resolve this, follow these steps:
-
Uninstall Older Java Versions
-
Open the Control Panel and go to "Programs and Features." 3" Locate all existing Java installations and uninstall them.
-
Restart your computer to ensure changes take effect.
-
Download and Install Java 17 or Higher
-
Visit the Oracle JDK Download page.
-
Select the latest stable version (Java 17 or higher).
8.Download the installer corresponding to your operating system.JavaInstall Java by following the installation prompts.
- Verify Java Installation
11.Open a command prompt (cmd) and run: java -version
-
Ensure the output reflects Java 17 or above.
-
Run the Application Again
-
Try executing the jar file: java -jar ripme-2.1.18-16-1342b621.jar
-
If the issue persists, ensure that your system is using the correcJavava version by running: where java
-
If system'ssversion appears, update your system’s PATH variable to the new Java installation.