(class file version 53.0), Java Runtime versions up to 52.0 Visual studio code

Viewed 109496

I'm trying to use visual studio code for Java.

Have installed the extensions for Java, and have a 1.8 JDK installed with environment variable pointing to the install.

When starting debugger with a simple hello world program, I get the following:

java.lang.UnsupportedClassVersionError: HelloWorld has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0 at java.lang.ClassLoader.defineClass1(Native Method) ...... ...... at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:495)

Any help with getting Java debugging in Visual Studio code appreciated.

1 Answers

You are probably compiling (or using dependencies compiled) with java 9, but still using JDK 8.0

Install java 9 and change your OS environment settings to point to the new JDK. This should solve your problem.

Related