The problem is, even after installing Sun's Java, GCJ is the default.
The default version of java can be changed using the update-java-alternatives command.
update-java-alternatives -l
will give the list of all installed java packages.example output:
java-1.5.0-sun 53 /usr/lib/jvm/java-1.5.0-sun
java-gcj 1042 /usr/lib/jvm/java-gcj
update-java-alternatives -s java-1.5.0-sun
will set Sun's java as the default.For some applications like Ant, Tomcat to run, you nee to set the JAVA_HOME environment variable like below
export JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun
The above export can be put in /etc/bash.bashrc (for all users) or /home/<user>/.bashrc (for a particular user) so that JAVA_HOME is available on logon.
No comments:
Post a Comment