Results 1 to 3 of 3
- 10-01-2007, 06:31 PM #1
Member
- Join Date
- Jun 2007
- Location
- Colombo, Sri Lanka
- Posts
- 32
- Rep Power
- 0
Problem with executing .jar files
Hi Everyone,
I'm developing using NetBeans 5.5 on Ubuntu Linux 7.04. Whenever I attempt to execute the Java applications I have developed directly from the Linux terminal (by executing the .jar file) I get an error. The following error appeared when I attempted to execute a simple HelloWorld application. Error is always the same.
hiranya@hiranya-homepc:~$ java -jar "/home/hiranya/projects/netbeans/HelloWorld/dist/HelloWorld.jar"
Exception in thread "main" java.lang.ClassFormatError: helloworld.Main (unrecognized class file version)
at java.lang.VMClassLoader.defineClass(libgcj.so.70)
at java.lang.ClassLoader.defineClass(libgcj.so.70)
at java.security.SecureClassLoader.defineClass(libgcj .so.70)
at java.net.URLClassLoader.findClass(libgcj.so.70)
at gnu.gcj.runtime.SystemClassLoader.findClass(libgcj .so.70)
at java.lang.ClassLoader.loadClass(libgcj.so.70)
at java.lang.ClassLoader.loadClass(libgcj.so.70)
at gnu.java.lang.MainThread.run(libgcj.so.70)
hiranya@hiranya-homepc:~$
Please enlighten me on what's going on and possible workarounds.
Thank you
Regards,
Hiranya
- 10-01-2007, 06:53 PM #2
Check version of the compiler you are using and the java interpreter!
For the compiler, you can check project properties by right clicking on your project. Somewhere there, it shows you which java version is your target for your class files. If it is targetted for java 1.6 but you try to run it with java 1.5 then it will report this error. Class format changes from version to version..
And you can check the version of the java interpreter you are using with your console by running following command on your console (I guess you are using gcj which as the interpreter and you should use java command in your JDK'sbin directory to solve the problem.):
java -version
- 10-02-2007, 07:24 PM #3
Member
- Join Date
- Jun 2007
- Location
- Colombo, Sri Lanka
- Posts
- 32
- Rep Power
- 0
Similar Threads
-
Problem with executing
By mcal in forum New To JavaReplies: 2Last Post: 02-09-2008, 01:51 PM -
problem with viewing .java files when Visual J# 2005 Express Edition exist
By unhurt in forum New To JavaReplies: 3Last Post: 11-03-2007, 01:58 PM -
Executing Batch
By zcoarens in forum New To JavaReplies: 0Last Post: 08-14-2007, 09:49 AM -
Problem while executing programs
By bks504 in forum New To JavaReplies: 10Last Post: 08-02-2007, 01:32 PM -
Executing a jar file
By peiceonly in forum New To JavaReplies: 2Last Post: 04-06-2007, 02:32 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks