I'm using maven, and I'm using vs code as my editor, and when I run mvn package
, and then:
java -cp target/rationalclosure-1.0-SNAPSHOT-jar-with-dependencies.jar org.rationalclosure.App
in order to see if things are working, I get the following error (I believe due to some conflict in terms of which version of java is being used by my terminal and which is being used by maven):
I am using Java 11 in my terminal, and have since downloaded the jdk for java 12, but I'm not sure how to change the version of java used by my terminal to version 12. My questions are:
a.) would doing this solve the problem?
b.) how do I do this?
Note: I'm using wsl on the Ubuntu app on Windows as my terminal.
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/tweetyproject/logics/pl/syntax/Proposition has been compiled by a more recent version of the Java Runtime (class file version 56.0), this version of the Java Runtime only recognizes class file versions up to 55.0
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:800)
at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:698)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:621)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:579)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
at org.rationalclosure.App.main(App.java:11)
Open Command Palette and choose Java: Configure Java Runtime. Turn to Java Tooling Runtime, select java12 as JDK for Language Server
:
Don't forget to reload Window to make this change effective.