LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   My .jar files wont install (http://www.linuxquestions.org/questions/programming-9/my-jar-files-wont-install-440275/)

icebyte 04-30-2006 10:48 AM

My .jar files wont install
 
Hi

I created a tiny program to just see if the .jar file would install on my system which it didnt. Below is the out messages i got when issuing this command: java -jar Myprogram2.jar

Output from the command:
Code:

Exception in thread "main" java.lang.UnsupportedClassVersionError: myprogram2/Main (Unsupported major.minor version 49.0)
        at java.lang.ClassLoader.defineClass0(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)

Why am i getting these error messages and what can i do to solve this problem? If someone could help then that would be nice :) If i create a program i want it to be able to install it on the system though

Mega Man X 04-30-2006 11:03 AM

Hi!

You may have to create a manifest file in order to make your jar file an executable. Take a look in here:

http://csdl.ics.hawaii.edu/~johnson/...jar-files.html

Some IDE's has the ability to create an executable jar file for you, such as Eclipse and BlueJ ;)

Regards!

icebyte 04-30-2006 11:14 AM

Quote:

Originally Posted by Mega Man X
Hi!

You may have to create a manifest file in order to make your jar file an executable. Take a look in here:

http://csdl.ics.hawaii.edu/~johnson/...jar-files.html

Some IDE's has the ability to create an executable jar file for you, such as Eclipse and BlueJ ;)

Regards!

Thanks for answering, i will check out that link, but should probably tell you that netbeans IDE created this jar file for me.

Edit: I found the solution now to my problem. The problem was that even when i have jre and jdk installed on my system i didnt have them in my path variable, so after exporting them i got it working. :)


All times are GMT -5. The time now is 08:50 PM.