Results 1 to 7 of 7
- 04-27-2012, 06:55 PM #1
Member
- Join Date
- Apr 2012
- Posts
- 4
- Rep Power
- 0
Problem running program on other computers
I am using NetBeans to write beginning Java programs. Sometimes my program will run at home, but when I try to run the same program at school, I get a series of error messages, usually of this form:
run:
java.lang.UnsupportedClassVersionError: shapebase/Project : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader. java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java :615)
at java.security.SecureClassLoader.defineClass(Secure ClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader .java:283)
at java.net.URLClassLoader.access$000(URLClassLoader. java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java: 197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.j ava:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:3 06)
at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:2 47)
Could not find the main class: shapebase.Project. Program will exit.
Exception in thread "main" Java Result: 1
BUILD SUCCESSFUL (total time: 0 seconds)
Of course the messages vary some due to different class names, etc, but they are essentially the same. Further more, if I create a new project on the second computer and copy the code into it, it works fine. What is probably causing this problem? Hopefully it is something simple I am neglecting!
Thanks!
- 04-27-2012, 07:38 PM #2
Senior Member
- Join Date
- Aug 2011
- Posts
- 116
- Rep Power
- 0
Re: Problem running program on other computers
A quick google search will give you your answer, its to do with the JDK you use to compile the program.
- 04-27-2012, 08:41 PM #3
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,406
- Blog Entries
- 7
- Rep Power
- 17
- 04-28-2012, 12:43 AM #4
Member
- Join Date
- Apr 2012
- Posts
- 4
- Rep Power
- 0
- 04-28-2012, 02:01 AM #5
Senior Member
- Join Date
- Aug 2011
- Posts
- 116
- Rep Power
- 0
- 04-28-2012, 02:08 AM #6
Re: Problem running program on other computers
It's the JDK that sets the version in the class file. A younger version JRE can run a class file from an older version of the JDK/javac command.
That's a problem for a lot of software and hardware. Backward compatibility has been a headache for decades. Newer features are not known by older versions of software. My wife works with multiple versions of MS Word and has cussed out the people that insist on using the newest versions many times.one has to be careful of matching JDKs or JVMsLast edited by Norm; 04-28-2012 at 12:59 PM. Reason: spelling
If you don't understand my response, don't ignore it, ask a question.
- 04-28-2012, 06:46 AM #7
Re: Problem running program on other computers
Why do they call it rush hour when nothing moves? - Robin Williams
Similar Threads
-
Problem running Simple Hello world program in Ubuntu
By teete in forum New To JavaReplies: 4Last Post: 04-24-2012, 08:08 PM -
Problem running DataGimmick program!!
By Bentino in forum New To JavaReplies: 1Last Post: 02-21-2012, 09:18 PM -
Need to have multiple computers run same java program
By thehighlander12 in forum NetworkingReplies: 11Last Post: 07-07-2010, 02:30 PM -
Problem with running an external program via java
By g123456 in forum New To JavaReplies: 4Last Post: 12-30-2009, 05:06 PM -
problem with connecting to another computers database
By rakesh_n_mehta in forum JDBCReplies: 0Last Post: 12-24-2008, 10:35 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks