Reputation: 601
I made a small project for a friend and when I build it in my pc in NetBeans I got the following errors:
Not copying library D:\share on eee\GeorgeApp\${libs.excel.classpath} , it can't be read.
Not copying library D:\share on eee\GeorgeApp\${libs.MySQLDriver_2.classpath} , it can't be read.
Not copying library D:\share on eee\GeorgeApp\${libs.Jcalendar.classpath} , it can't be read.
Not copying library D:\share on eee\GeorgeApp\${libs.AutoComplete.classpath} , it can't be read.
I take the jar file that is being created with the lib folder as well and execute them in my pc witch run under ubuntu. Works great. In my wifes pc witch run windows also run great. When I try to run it in my friends pc I got an error that says that the main class can not be found. Is it relevant with the errors I take in my building prosses?
In my friends pc I tried have installed JRE and even JDK ... but nothing. I then installed the Netbeans in his pc and built again the project but nothing ...even in Netbeans run normally.
These are what I get when I try to run it
unknown@unknown-pc:~$ java -jar "/home/unknown/NetBeansProjects/ProtocolProject/GeorgeApp/dist/GeorgeApp.jar"
Exception in thread "main" java.lang.UnsupportedClassVersionError: georgeapp/GeorgeApp : 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: georgeapp.GeorgeApp. Program will exit.
unknown@unknown-pc:~$
Any idea what might be the problem and how can I avoid these errors to appear in my pc when I build the project?
Thank you!
Upvotes: 0
Views: 910
Reputation: 6499
java.lang.UnsupportedClassVersionErron is for issue when you trying to run classes compiled with JDK X under JDK/JRE Y where X > Y. Try to install the same JRE/JDK at your friend's PC, that you have.
Your build errors are probably ecause property is not substituted correctly to these strings: eee\GeorgeApp\${libs.excel.classpath}.
Upvotes: 1