[NTLUG:Discuss] Path for Java

Greg Edwards greg at nas-inet.com
Thu Dec 7 23:41:27 CST 2006


Tom Hayden wrote:
> I have recently installed java on my Linux machine and am having trouble 
> getting the PATH set right. I an running Debian with the KDE desk top. I 
> set the PATH to point to the directory which has Java in it. If I open 
> up a ROOT terminal from the start menu, everything works find. If I open 
> up a USER terminal from the start menu, it can not find Java. After some 
> research, it appears there are 8 or 10 different files where PATH can be 
> set. Can any one point me to the correct one for USER terminal windows.? 
> If you need more information, please let me know.
> 

I assume Debian follows this init sequence.

You should have an /etc/profile.d directory that is read by /etc/profile 
on user login.  That dir should have java related files that will be 
loaded.  Here's mine

/etc/profile.d/jre-1.4.2_05.sh

if [ -z "$JAVA_HOME" ]; then
   export JAVA_HOME=/usr/lib/jre-1.4.2_05
   export PATH="$PATH:$JAVA_HOME/bin"
fi

/etc/profile.d/jre-1.4.2_05.csh

if ( ! $?JAVA_HOME ) then
   setenv JAVA_HOME /usr/lib/jre-1.4.2_05
   setenv PATH "${PATH}:${JAVA_HOME}/bin"
endif

from /etc/profile

for i in /etc/profile.d/*.sh ; do
         if [ -x $i ]; then
                 . $i
         fi
done

HTH

-- 
Greg Edwards
http://INeedMyInfo.com



More information about the Discuss mailing list