LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   opening .jar files? (https://www.linuxquestions.org/questions/linux-newbie-8/opening-jar-files-947874/)

imGibe 05-31-2012 08:29 PM

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! :)

acid_kewpie 06-01-2012 03:09 AM

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?

whysoserious 06-01-2012 05:31 AM

What is the exact output if the error?

qlue 06-01-2012 09:12 AM

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)

cdvries 06-01-2012 12:53 PM

Quote:

Originally Posted by imGibe (Post 4692471)
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....

anomie 06-01-2012 02:00 PM

Also, do you wish to run the JAR file, or extract its contents? (Not sure what you mean by "opening".)

cdvries 06-01-2012 02:13 PM

Quote:

Originally Posted by anomie (Post 4693258)
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>

peglegwookie 06-01-2012 04:27 PM

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.

John VV 06-01-2012 08:19 PM

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

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


All times are GMT -5. The time now is 05:23 AM.