Feb 10, 2009

How to add JAVA_HOME variable in SUSE 10.2/SUN Java

I needed to install a latest Java build, that is not included in SUSE software DVD. So, I've downloaded a Java RPM from Sun's site, have installed it, but the $JAVA_HOME variable was still undefined. The problem was in /etc/profile.d/alljava.sh file. This script could work only with SUSE-bundled Java, because it do test if predefined paths exists.

So I've created a script named sunjava.sh and put it into the /etc/profile.d/ folder. You can see the script contetnt below:

export JAVA_ROOT=/usr/java
export JAVA_HOME=$JAVA_ROOT/default
export JAVA_BINDIR=$JAVA_HOME/bin

No comments: