Newbie java classpath problem
I have just installed slackware 12 onto my machine. I have noticed that the java runtime and jdk is currently present version 1.6.0_01-bo6. I have tried to run javac but getting the bad command error ie noc classpath set. However i added this to the profile in etc:-
PATH=$PATH:/usr/lib/jre1.6.0_01-bo6 JAVA_HOME=/usr/lib/jre1.6.0_01-b06 export $PATH $JAVA_HOME Now when i log out and log back in i get the foillowing error message -bash export:/PATH=$PATH:/usr/lib/jre1.6.0_01-bo6 not a valid identifier i would appreciate any help whatsoever. |
Try
Code:
export PATH=$PATH:/usr/lib/jre1.6.0_01-bo6/bin |
Newbie java classpath problem
thank you for your response, however, I have tried that and it does not work .
|
What is the output of
Code:
ls /usr/lib/jre1.6.0_01-bo6 Code:
echo $PATH |
setting java classpath
Ok the output from the line ls /usr/lib/jre1.6.0_01-bo6 is a list of the directory which is
welcome.html copyright readme license javaws/ bin/ plugin/ koala.jar man/ qtjava.jar and the output from echo $Path is nothing Does that look correct |
Not really. ;-)
Did you type Code:
echo $Path Code:
echo $PATH |
Ah sorry yes you are correct i typed echo $Path rather than echo $PATH, i typed echo $PATH and this is the output
/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:bin:/usr/games:/usr/lib/java/bin: /usr/lib/java/jre/bin:/usr/lib/qt/bin:/usr/share/textmf/bin:/usr/lib/jre1.6.0_01 So from what i can see my java and jre are there and recognised but why wont the javac command work? |
This path looks much better.
If I see correctly, you have installed a java runtime environment (jre), what includes everything tu run java applications. You should be able to run something like Code:
java -version The jdk comes as executable file that installs the jdk (non graphical, at command line) once launched. After installing whereever you want, you have to adjust your $JAVA_HOME and $PATH again. I should have seen this before, sorry. Hope this one helps, Clemente |
UPDATE: You propably will not be able to run java -version as stated before...
A closer look to your echo $PATH output shows the part: Quote:
Quote:
With your current $PATH, you will start something in /usr/lib/java/bin, if present, or in /usr/lib/jre1.6.0_01. But nothing in /usr/lib/jre1.6.0_01-bo6/bin, what I suppose you to want. Sound weird. ;-) You can clean your classpath, or (the dirty way), you can export the $PATH with Code:
export PATH=/path/ro/your/jdk/bin:$PATH Code:
export PATH=$PATH:/path/ro/your/jdk/bin Less work, but little dirty. |
Hi thanks for that, however, when i type java -version i get jre1.6.0_01-bo6
What i want to know is how do i get my compiler to compile, will someone tell me what i have to do. If i have to type a file in profile or profile.d or what i dont care i just want to get this working. |
Its already been mentioned that javac is not available if you only have the jre installed. You need to install the jdk if you want to do java development. Cheers.
|
Hi to all of the people who have posted back to my request for help, well I have loaded the jdk and I now have a running java compiler, thank you.
|
All times are GMT -5. The time now is 05:21 PM. |