(class version version 53.0), Java Runtime version up to 52.0 Visual Studio Code

I am trying to use visual studio code for Java.

Installed extensions for Java and installed 1.8 JDKs with an environment variable indicating installation.

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

java.lang.UnsupportedClassVersionError: HelloWorld was compiled by a later version of Java Runtime (class file version 53.0), this version of Java Runtime only recognizes class file versions up to 52.0 in java.lang.ClassLoader.defineClass1 (native method) ...... ...... on sun.launcher.LauncherHelper.checkAndLoadMain (LauncherHelper.java:495)

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

+5
source share
1 answer

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

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

+4
source

Source: https://habr.com/ru/post/1273111/


All Articles