Go Back   Forums > Community Chatterbox > Tech Corner > Programming
Memberlist Forum Rules Search Today's Posts Mark Forums Read
Search Forums:
Click here to use Advanced Search

Reply
 
Thread Tools Display Modes
Old 18-03-2007, 09:48 PM   #1
Ioncannon
Abandonia Homie

 
Join Date: Mar 2004
Location: Mississauga, Canada
Posts: 558
Send a message via MSN to Ioncannon
Default

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 >.<):
Ioncannon is offline                         Send a private message to Ioncannon
Reply With Quote
Old 19-03-2007, 07:48 AM   #2
nitro
Forum hobbit

 
Join Date: Jan 2007
Location: Nunspeet, Netherlands
Posts: 31
Default

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"
Which JDK version did you use to compile this program?

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.
I think something strange has happened when you compiled the program.
BTW I'm using Sun JDK 1.5.0_09
nitro is offline                         Send a private message to nitro
Reply With Quote
Old 19-03-2007, 10:47 PM   #3
Ioncannon
Abandonia Homie

 
Join Date: Mar 2004
Location: Mississauga, Canada
Posts: 558
Send a message via MSN to Ioncannon
Default

JDK 1.6.0
Ioncannon is offline                         Send a private message to Ioncannon
Reply With Quote
Old 20-03-2007, 05:42 PM   #4
nitro
Forum hobbit

 
Join Date: Jan 2007
Location: Nunspeet, Netherlands
Posts: 31
Default

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.
nitro is offline                         Send a private message to nitro
Reply With Quote
Old 22-03-2007, 06:25 AM   #5
STFM
Abandonia nerd

 
Join Date: Sep 2005
Location: ,
Posts: 96
Default

Yeah you cant always run newer java programs with older runtimes
STFM is offline                         Send a private message to STFM
Reply With Quote
Reply


Similar Threads
Thread Thread Starter Forum Replies Last Post
.ISO file sgtboat Troubleshooting 3 15-10-2008 11:15 AM
Need Help For A Zip File Cold Tech Corner 11 19-09-2007 01:59 PM
Where Is The Exe. File. oyjah Troubleshooting 2 18-06-2006 11:54 PM
Bin But No Cue File? Guest_matt Troubleshooting 8 09-08-2005 09:05 PM
Pif File Guest Troubleshooting 8 28-04-2005 10:08 PM

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump
 


The current time is 04:34 AM (GMT)

 
Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.