LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Distributions (https://www.linuxquestions.org/questions/linux-distributions-5/)
-   -   Mandrake and the command java -jar (https://www.linuxquestions.org/questions/linux-distributions-5/mandrake-and-the-command-java-jar-36208/)

silent1_22 11-22-2002 05:47 PM

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 :D (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.
thanks

I'm a :newbie: 4ever

MasterC 11-22-2002 06:44 PM

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 'java.sh' as 'root' in '/etc/profile.d' containing these lines (replacing directories according to your java setup of course):

JAVA_HOME=/usr/java/j2sdk1.4.1
export JAVA_HOME
PATH=$PATH:$JAVA_HOME/bin
export PATH

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

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.

Cool

silent1_22 11-23-2002 05:23 AM

Didn't work
 
Ok i created the file 'java.sh'. 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 java.sh file?

silent1_22 11-23-2002 06:25 AM

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

JAVA_HOME=/usr/java/j2sdk1.4.1_01
export JAVA_HOME
PATH=$PATH:$JAVA_HOME/bin
export PATH

So I erased it all and just put:
PATH=$PATH:/usr/java/j2sdk1.4.1_01/bin

And now it works like a charm :D

Thanx a million


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