LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 09-28-2010, 02:13 PM   #1
Mostofi
LQ Newbie
 
Registered: Sep 2009
Location: IRI
Distribution: Ubuntu 11.10
Posts: 21

Rep: Reputation: 0
Exclamation 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?
 
Old 09-28-2010, 02:36 PM   #2
alunduil
Member
 
Registered: Feb 2005
Location: San Antonio, TX
Distribution: Gentoo
Posts: 684

Rep: Reputation: 62
You simply do java <jar file> if I remember correctly.

Regards,

Alunduil
 
Old 09-28-2010, 02:41 PM   #3
Mostofi
LQ Newbie
 
Registered: Sep 2009
Location: IRI
Distribution: Ubuntu 11.10
Posts: 21

Original Poster
Rep: Reputation: 0
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."
 
Old 09-28-2010, 02:48 PM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
To run .jar files you need
Code:
java -jar /home/mahdi/Downloads/something.jar
Cheers
 
1 members found this post helpful.
Old 09-28-2010, 02:52 PM   #5
Mostofi
LQ Newbie
 
Registered: Sep 2009
Location: IRI
Distribution: Ubuntu 11.10
Posts: 21

Original Poster
Rep: Reputation: 0
Thanks

Thanks,
I could finally run it.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Help with running a jar. files on my eeepc 4g specific help required! ineedhelprightnow Linux - Newbie 32 07-24-2010 05:56 AM
running .jar files computerages Linux - General 13 08-19-2006 07:59 PM
trouble with JRE 1.5 and running a .jar toaster.waffle Linux - Software 4 06-21-2006 11:33 PM
Fedora Core 1 Associating .jar files with java -jar command pymehta Fedora 0 01-13-2005 05:26 AM
Installing Java running jar files jariep Red Hat 1 04-12-2004 11:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration