I am using Windows 10, VS Code with the Java Development Kit from the VS Code site, Amazon Corretto 11.0.5_10 and have my java.home path set to the program's directory and it is showing as correct in the Java Development kit.
So far I have tried: - Reinstalling the JDK, no change - Using the OpenJDK 11, same issue
The error I am getting.
PS D:\projects\Learning Sandbox\Java> & 'C:\Users\lavic\.vscode\extensions\vscjava.vscode-java-debug-0.23.0\scripts\launcher.bat' 'C:\Program Files\Amazon Corretto\jdk11.0.5_10\bin\java' '--enable-preview' '-Dfile.encoding=UTF-8' '-cp' 'C:\Users\lavic\AppData\Roaming\Code\User\workspaceStorage\78403716f5d459852c5885ad9cb3cb98\redhat.java\jdt_ws\Java_67cee730\bin' 'HelloWorld'
Error: LinkageError occurred while loading main class HelloWorld
java.lang.UnsupportedClassVersionError: HelloWorld (class file version 57.65535) was compiled with preview features that are unsupported. This version of the Java Runtime only recognizes preview features for class file version 55.65535
PS D:\projects\Learning Sandbox\Java>
The code I am attempting to run.
public class HelloWorld {
public static void main(String[] args) {
}
}
Thanks for the help in advance!
Edit The answer was found here: https://stackoverflow.com/a/55455633/8534275