![]() |
#1 | ||
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
![]() So I finally finished coding my text engine in java and create the jar file to show a friend. It works correctly on my PC but on his Virtual Machine spits out a "Cannot find main class" error message. Only difference between the two computers is I have the java dev kit. I tested it on other computers w/o the JDK (but they have the JRE) and same error happens. Is something incorrect in the manifest, or is it my code? Can anyone help with this?
Attached is both the current JAR and the java files (Sorry if the code looks extremely messy >.<): |
||
![]() ![]() |
|
![]() |
#2 | ||
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jan 2007
Location: Nunspeet, Netherlands
Posts: 31
|
![]() I also get this error. I don't know what is wrong but when I start it from the command line I get a different error:
Code:
$ java -jar textg.jar java.lang.UnsupportedClassVersionError: Bad version number in .class file ********at java.lang.ClassLoader.defineClass1(Native Method) ********at java.lang.ClassLoader.defineClass(Unknown Source) ********at java.security.SecureClassLoader.defineClass(Unknown Source) ********at java.net.URLClassLoader.defineClass(Unknown Source) ********at java.net.URLClassLoader.access$100(Unknown Source) ********at java.net.URLClassLoader$1.run(Unknown Source) ********at java.security.AccessController.doPrivileged(Native Method) ********at java.net.URLClassLoader.findClass(Unknown Source) ********at java.lang.ClassLoader.loadClass(Unknown Source) ********at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) ********at java.lang.ClassLoader.loadClass(Unknown Source) ********at java.lang.ClassLoader.loadClassInternal(Unknown Source) Exception in thread "main" EDIT: I just recompiled and repackaged your code with the same manifest so that's not your problem. I did get a notice during the compilation Code:
Note: GUI_Textg.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. BTW I'm using Sun JDK 1.5.0_09 |
||
![]() ![]() |
|
![]() |
#3 | ||
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
![]() JDK 1.6.0
|
||
![]() ![]() |
|
![]() |
#4 | ||
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jan 2007
Location: Nunspeet, Netherlands
Posts: 31
|
![]() I downloaded and installed JDK 1.6.0 and now I can run your jar file. I think the problem is with different version of java. You should check the computer that doesn't work for which Java version it has.
|
||
![]() ![]() |
|
![]() |
#5 | ||
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Join Date: Sep 2005
Location: ,
Posts: 96
|
![]() Yeah you cant always run newer java programs with older runtimes
|
||
![]() ![]() |
|
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
.ISO file | sgtboat | Troubleshooting | 3 | 15-10-2008 10:15 AM |
Need Help For A Zip File | Cold | Tech Corner | 11 | 19-09-2007 12:59 PM |
Where Is The Exe. File. | oyjah | Troubleshooting | 2 | 18-06-2006 10:54 PM |
Bin But No Cue File? | Guest_matt | Troubleshooting | 8 | 09-08-2005 08:05 PM |
Pif File | Guest | Troubleshooting | 8 | 28-04-2005 09:08 PM |
|
|
||
  |