View the Most Wanted LQ Wiki articles.
Go Back > Forums > Linux Forums > Linux - Distributions
User Name
Linux - Distributions This forum is for Distribution specific questions.
Red Hat, Slackware, Debian, Novell, LFS, Mandriva, Ubuntu, Fedora - the list goes on and on... Note: An (*) indicates there is no official participation from that distribution here at LQ.


  Search this Thread
Old 11-22-2002, 06:47 PM   #1
LQ Newbie
Registered: Nov 2002
Posts: 7

Rep: Reputation: 0
Unhappy Mandrake and the command java -jar

Ok, i've done a search already and found nothing that helped and posted replies to similar posts but everyone seems to be overlooking my reply and only keeping rappor with whomever started the thread. My question, I would think should be a simple question for even a semi linux guru or and advanced newbie. I've only been using linux for 3 days now starting with lindows, but i didn't like the fact you had to pay for free software. So I heard mandrake would be a good start, which it has been great so far. Especially in KDE 3.0. So far i found answers to most of my questions by searches. Except this one; when i was running lindows and typed the command "java -jar <filename>.jar" the file started. Now, in mandrake I try this and get "unknown command" or something like it. I though it probably had to do with security because i had j2re-1_4_1_01 installed. So I set my security back to standard from paranoia (I'm messing with server stuff so i wanted to make sure it would be a hassle for someone to poke at my system) and it still didn't work.
Can anyone tell me how to install jar files?
Or tell me what to do about the java command.
The software i'm trying to install is LimeWire. I even tried the .sh file but in that file itself has a java command which comes up "line 14: java: unknown command".
Please someone help me or at the least if this question is actually more difficult than it sounds tell me.

I'm a 4ever
Old 11-22-2002, 07:44 PM   #2
LQ Guru
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
Yeah, it's a little bit more than you'd think... But no worries on difficulty level, after all, that's a good way to learn.

Anyway, you need to see if the "java" directory is in your PATH. So, you'll wanna first find the java directory, if you installed it yourself, then you probably know where it's at, if it came with your distro, then you might have to do a little hunting around. Try this as a start:
find /usr | grep java

Also, just for a hope, check in /usr/local/java to see if it's there.

Anyway, once you pin that down (make sure you have the correct directory) and then check your PATH:
echo $PATH

This should display your current path either for the system or the current user, or both. If you don't see the directory for the java folder that you found earlier, then you'll have to add it to your PATH. A "quick" way to do that is to export it, which is probably the easiest, but not long lasting way (will go away after a reboot, or logout) or this way:

Create a file called '' as 'root' in '/etc/profile.d' containing these lines (replacing directories according to your java setup of course):

export JAVA_HOME
export PATH

Then make the file executable (meaning in a terminal, as root type):
chmod +x

Ok, so now you SHOULD have that all taken care of, java is in your PATH (you can check with the above command: echo $PATH) and now you can go on with the rest of the java fun.

Old 11-23-2002, 06:23 AM   #3
LQ Newbie
Registered: Nov 2002
Posts: 7

Original Poster
Rep: Reputation: 0
Unhappy Didn't work

Ok i created the file ''. How to create it i'm assuming with just a text editor? I used kedit. Then I did the chmod command in the terminal under root in the profile.d directory. Then i typed 'echo $PATH' and still no java in there. Am i suppose to run the file?
Old 11-23-2002, 07:25 AM   #4
LQ Newbie
Registered: Nov 2002
Posts: 7

Original Poster
Rep: Reputation: 0

I got it working! For some reason what you told me to write in the file wasn't working.

export JAVA_HOME
export PATH

So I erased it all and just put:

And now it works like a charm

Thanx a million


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
How to run a java jar file. sabliny Programming 7 11-05-2005 02:59 PM
How jar java program? treotan Programming 3 09-08-2005 01:03 AM
Fedora Core 1 Associating .jar files with java -jar command pymehta Fedora 0 01-13-2005 06:26 AM
Compile Java - .class, .java, .jar ? woranl Programming 2 11-09-2004 11:12 PM
executable jar in java (cannot double click) spyghost Programming 3 09-29-2003 10:13 AM

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

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