How to run the executable JAR file with a specific configuration?

My code can be run in Eclipse with the run configuration " 9001 9001 "

Now export the executable jar file and hope to run it in cmd

When use "java -jar test.jar 9001 9001", it shows error: Picture of error in cmd so is that command right?


The UnsupportedClassVersionError error means that you are trying to run your code with a version of Java older than the one you used to compile it.

Version 52.0 is Java 8 so you are trying to run the code with Java 7 or earlier.

Either run the code with Java 8 or change the compilation settings in Eclipse.

There is lots more discussion about this in this Stack Overflow question.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.