How to set java path in Linux?
Ans : Check where java is installed by using below command
#update-alternatives --config java
This command will show installed java packages in your machine.
Example output :
# update-alternatives --config java
There are 2 programs which provide 'java'.
Selection ----------------------------------------------- 1 /usr/lib/jvm/jre-1.4.2-gcj/bin/java *+ 2
From above you can see java version in use it. 1.6.
Setting java path(In Temporary way)
#JAVA_HOME=/usr/lib/jvm/jre-1.6.0-openjdk #export $JAVA_HOME
Setting java path (In Permanent way)
Edit ~/.bashrc and place below two lines in that file and save the file.
Vi ~/.bashrc
JAVA_HOME=/usr/lib/jvm/jre-1.6.0-openjdk export $JAVA_HOME
Now save the file and exit, then logout and login to make those changes to reflect.
Command
/usr/lib/jvm/jre-1.6.0-openjdk/bin/java
How To Set Java Path In Linux?
12/10/2010 08:58:00 PM Posted by Meghana M BhombhoreLabels: How-To's
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment