I am having trouble trying to run a .jar application on Kubuntu. I created an application in NetBeans in Windows and compiled it into a .jar file. First Windows couldn't find the main class. I searched the internet and fixed some registry values for the JRE and everything works fine now. However, the same problem has arised in Kubuntu, but I can't find anything of help. I've even tried uncompressing the .jar file and modifing the class path in the manifest file with many different path addresses, but nothing works.
Since the problem in Windows was on the JRE and not on my application, I think the same is happening in Kubuntu. An important note is that I've installed NetBeans on Kubuntu too and when I debug or run the application under Netbeans, it works fine, but when I compile it and try to run it with:
java -jar "MBoxTest.jar"
I get the same errors I got on Windows including the final one that says it cannot find the main class:
Exception in thread "main" java.lang.UnsupportedClassVersionError: my/mboxtestui/MBoxTestUI : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
Could not find the main class: my.mboxtestui.MBoxTestUI. Program will exit.