LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-31-2012, 09:29 PM   #1
imGibe
LQ Newbie
 
Registered: May 2012
Posts: 1

Rep: Reputation: Disabled
opening .jar files?


I'm on ubuntu.

I tried this command:

java -jar something.jar

But it says unable to access it. The .jar file is on my desktop, And just saying i'm really new to ubuntu, Just got it yesterday. So don't make your reply sound really complicated, Thanks!
 
Old 06-01-2012, 04:09 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
where did you do that? For that to work you'd need to be in the same directory as the jar file, so a "cd Desktop" or similar should get you there.

And it did say it couldn't find the jar file, right? Not that it couldn't find the java executable?
 
Old 06-01-2012, 06:31 AM   #3
whysoserious
Member
 
Registered: May 2012
Location: London
Distribution: Debian and slackware for uni
Posts: 61

Rep: Reputation: Disabled
What is the exact output if the error?
 
Old 06-01-2012, 10:12 AM   #4
qlue
Member
 
Registered: Aug 2009
Location: Umzinto, South Africa
Distribution: Crunchbangified Debian 8 (Jessie)
Posts: 747
Blog Entries: 1

Rep: Reputation: 172Reputation: 172
If you have the Java run-time installed, you should be able to simply double click on the .jar to launch it.
(from your file manager)
 
Old 06-01-2012, 01:53 PM   #5
cdvries
LQ Newbie
 
Registered: Jun 2012
Location: Netherlands
Distribution: Mint, Debian and Ubuntu are my favorites
Posts: 7

Rep: Reputation: Disabled
Quote:
Originally Posted by imGibe View Post
I'm on ubuntu.

I tried this command:

java -jar something.jar

But it says unable to access it. The .jar file is on my desktop, And just saying i'm really new to ubuntu, Just got it yesterday. So don't make your reply sound really complicated, Thanks!
try:
java -jar ~/Desktop/something.jar ??

what do you get when you type java -version ?
if you don't have java then type
sudo apt-get install openjdk-7-jre to install the jre.

hope this helps....
 
Old 06-01-2012, 03:00 PM   #6
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Also, do you wish to run the JAR file, or extract its contents? (Not sure what you mean by "opening".)
 
Old 06-01-2012, 03:13 PM   #7
cdvries
LQ Newbie
 
Registered: Jun 2012
Location: Netherlands
Distribution: Mint, Debian and Ubuntu are my favorites
Posts: 7

Rep: Reputation: Disabled
Quote:
Originally Posted by anomie View Post
Also, do you wish to run the JAR file, or extract its contents? (Not sure what you mean by "opening".)
yea. jar files are just zip files basically. You can unzip them

unzip <jarfile>
 
Old 06-01-2012, 05:27 PM   #8
peglegwookie
LQ Newbie
 
Registered: May 2012
Distribution: Linux Mint 13
Posts: 2

Rep: Reputation: Disabled
I found a website that shows a simple way to open files like minecraft.jar when you click on them. I could not for the life of me remember how to do this but this gentleman showed how here http://alexsleat.co.uk/2010/06/07/howto-run-jar-files-in-ubuntu/comment-page-1/#comment-13593

All I had to do was to change the default application that Mint uses to open the minecraft.jar file. This will help with the convenience factor for certain jar files you may use.

edit:
this assumes that you have it running correctly.

Last edited by peglegwookie; 06-01-2012 at 05:43 PM.
 
Old 06-01-2012, 09:19 PM   #9
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 16,989

Rep: Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447
if you ONLY want to "open" the jar and it is on your Desktop???????
ok on the desktop

r-click on it and open it with the archive manager

but if it is gnome3 or kde4 the r-click menu is NOT usable on the desktop for tasks like this
it is recommended you save things in the DEFAULT "Downloads" folder and not to the desktop
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
jar files Knowledgements Slackware 12 07-22-2005 04:36 AM
Fedora Core 1 Associating .jar files with java -jar command pymehta Fedora 0 01-13-2005 06:26 AM
Jar files krazibon3 Linux - Newbie 3 08-05-2004 10:42 PM
What do i do with .jar files joeman3429 Fedora 11 07-26-2004 12:00 PM
jar files mlynch147 Programming 2 10-24-2001 08:11 AM


All times are GMT -5. The time now is 12:20 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration