Java .jar file doesn't run, but it runs in VSCode

1.3k views Asked by At

I am using VSCode. When in VScode, I press F5 to run my java app, it runs successfully. The problem is when I click the export jar button, it builds the .jar file, but when I double click on the .jar file, it doesn't run. I am not using any build tools. I am also using java swing.

When I run from the console it outputs:

Error: LinkageError occurred while loading main class Main java.lang.UnsupportedClassVersionError: 
    Preview features are not enabled for Main (class file version 59.65535). – 
0

There are 0 answers