8
I have a project in Netbeans and I have to pass it to test for other users. I am running it on Ubuntu 14 and running the following command to run . jar:
java -jar "TesteTableYasc.jar"
However, when trying to run the file . jar gives Java version error. The error is as follows:
Exception in thread "main" java.lang.UnsupportedClassVersionError: yasc/Main : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:803)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
When executing java -version:
java version "1.7.0_111"
OpenJDK Runtime Environment (IcedTea 2.6.7) (7u111-2.6.7-0ubuntu0.14.04.3)
OpenJDK Client VM (build 24.111-b01, mixed mode, sharing)
When executing javac -version:
javac 1.6.0_40
How can I fix this mistake?
You seem to be mixing various concepts and heading straight for the solution to what you assume is the problem. I’m suspecting that this is a XY problem. It would be more productive to start from the beginning: how are you running this JAR? What error do you receive?
– Pablo Almeida
I updated the question
– Renan Alboy
Run on the terminal
java -version
andjavac -version
and paste in the question the result of both.– user28595
I put in question the exit of the commands
– Renan Alboy
The build path of your IDE must be pointing to Java 8. Switch to Java 7.
– igventurelli