LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (http://www.linuxquestions.org/questions/ubuntu-63/)
-   -   Running .jar Files (http://www.linuxquestions.org/questions/ubuntu-63/running-jar-files-834998/)

Mostofi 09-28-2010 03:13 PM

Running .jar Files
 
I have downloaded a .jar file and I run it with openJDK.
But Ubuntu says "The file '/home/mahdi/Downloads/something.jar' is not marked as executable. If this was downloaded or copied form an untrusted source, it may be dangerous to run. For more details, read about the executable bit."
I just wanna run it. Any help?

alunduil 09-28-2010 03:36 PM

You simply do java <jar file> if I remember correctly.

Regards,

Alunduil

Mostofi 09-28-2010 03:41 PM

It now gives this problem.

"Exception in thread "main" java.lang.NoClassDefFoundError: //freedom/jar
Caused by: java.lang.ClassNotFoundException: ..freedom.jar
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
Could not find the main class: ./freedom.jar. Program will exit."

bathory 09-28-2010 03:48 PM

To run .jar files you need
Code:

java -jar /home/mahdi/Downloads/something.jar
Cheers

Mostofi 09-28-2010 03:52 PM

Thanks
 
Thanks,
I could finally run it.


All times are GMT -5. The time now is 07:54 AM.