I need step-by-step instructions on how to set up the JAVA_HOME and CLASSPATH variables. Can anyone help me out with this issue?
Thanks in advance.
I need step-by-step instructions on how to set up the JAVA_HOME and CLASSPATH variables. Can anyone help me out with this issue?
Thanks in advance.
it depends on what implementation of java you have installed, where it is installed, and a number of other things.
If you already know what you want to set JAVA_HOME and CLASSPATH to, you can just run
and then add a line for each variable.Code:sudo gedit /etc/environment
Thanks tedwardo2, it worked perfectly fine.
See you around.
This is the output of the "etc/environment" file after I "gedit" it,
It may serve you as a guide to you folks looking for help.Code:PATH="/usr/local/Java/jdk1.5.0_07/bin:.:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/usr/games" LANG="en_AU.UTF-8" LANGUAGE="en_AU:en" JAVA_HOME="/usr/local/Java/jdk1.5.0_07" CLASSPATH="/usr/local/Java/jdk1.5.0_07/lib:."
Last edited by DapperDrakeNewbieDR; October 22nd, 2006 at 10:43 PM.
hey,
Thanks
It helped me. Now I can see classpath with echo $CLASSPATH.
regards,
Ishan
i'm having the same problem, but i don't know exactly what to do. i installed jdk and jre trough apt-get but i can't find "/usr/local/Java/jdk1.5.0_07/bin:." or any of the others path you used.
The best i was able to do was to find the java folder in usr/share but i can't find anything like jdk1.5.0_07/bin:. in it. This is the content of the java folder :
wich path should i use? doi need to install somtging else? atm the content of my etc/environment is:
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
LANG="it_IT.UTF-8
thx in advice for help
P.S. sry for may bad english
The easiest way to find it is to use the command
whcih java
which probably says /usr/bin/java, but this is a symlink. if you do
ls -l /usr/bin/java
it will tell you where it links to (probably another symlink). Keep on followinf the symlinks until you find the real executable. It's there somewhere.
If you install java straight from Sun, it defaults into /opt/java..., but the Ubuntu packagers tend to put java in /usr/lib or /usr/share or something like that.
P.S.
With the Sun JRE, you don't normally need to set JAVA_HOME or CLASSPATH at all.
If you have installed java through sudo apt-get install ......
then it is installed in /usr/lib/jvm
euhm.. is my case:
which java
/usr/bin/java
ls -l /usr/bin/java
/usr/bin/java -> /etc/alternatives/java
ls -l /etc/alternatives/java
/etc/alternatives/java -> /usr/lib/jvm/java-gcj/jre/bin/java
Changed that to:
java -> /usr/lib/jvm/java-6-sun-1.6.0.06/jre/bin/java
then I added the following line to /etv/environment:
JAVA_HOME="/usr/lib/jvm/java-6-sun-1.6.0.06/"
and created the following symlink:
/usr/java/jdk -> /usr/lib/jvm/java-6-sun-1.6.0.06/
although I have both... java is sooooo confusing!!
Last edited by bwakkie; June 30th, 2008 at 02:54 PM.
HW: Intel Core 2 CPU T7400 @ 1.66GHz, Dell Latitude D620, Intel Mobile 945GM/PM/GMS 943/940GML Express IGP + ICH7-M, 2014MB, 160GB, 1280x800 -- OS: Gentoo 2004-2010 & Ubuntu 7.4-10.10
Bookmarks