[TriLUG] Global JAVA_HOME variable?

Steve steve at kuekes.homeip.net
Tue Mar 5 08:48:39 EST 2002


Kevin - The Alchemist - Sonney wrote:
> 
> On Tue, 2002-03-05 at 08:27, Janyne Kizer wrote:
> > I was wondering if there is a good way to set a system wide variable for
> > JAVA_HOME?  I understand setting it in each person's .bash_profile but I
> > would prefer to set it once for the system if possible so that if/when
> > we change to a newer JRE we only have to change the path in one place.
> 
> 1- You can set system variables in /etc/profile
> 2 - I usually create a symlink from /usr/local/java to the proper
> JAVA_HOME and set the system JAVA_HOME=/usr/local/java - that way, when
> I upgrade the JDK, I just change the symlink, and it's done.
> 

I set my JAVA_HOME and path, etc in /etc/profile.d  I just place a java.sh
script there.  All these scripts are run as part of the login.  These scripts
are executed as part of the /etc/profile script.  This keeps me from changing
the standard redhat profile script.  Here's mine....

#
PATH=$PATH:/usr/local/bin:/usr/java/jdk1.3.1_01/bin
export PATH
CLASSPATH=.:/var/tomcat4/common/lib/servlet.jar:/var/tomcat4/common/lib/log4j.jar:/usr/share/pgsql/jdbc7.1-1.2.jar
#CLASSPATH=.:/usr/local/jakarta-servletapi-3.2/lib/servlet.jar:/usr/local/jakarta-log4j-1.1.3/dist/classes:/usr/local/j2sdkee1.3/lib/j2ee.jar:/usr/java:/usr/lib/pgsql/jdbc6.5-1.2.jar
export CLASSPATH
JAVA_HOME=/usr/java/jdk1.3.1_01
export JAVA_HOME

-- 
Steve Kuekes

Private Pilot: N9259R '95 Saratoga based at Sanford-Lee County Regional (TTA)
email: skuekes at nc.rr.com



More information about the TriLUG mailing list