Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 12-04-2012, 06:05 AM   #1
Registered: Aug 2011
Location: India
Distribution: Cent OS & Ubuntu
Posts: 107

Rep: Reputation: 3
Set JAVA environment variable path

how to set java and ant environment variable path or can any one tell me how to set the path of tools.jar?
Old 12-04-2012, 06:30 AM   #2
Registered: Jul 2012
Distribution: Ubuntu
Posts: 197
Blog Entries: 3

Rep: Reputation: 23
Here is how to set the path for Java. Suppose you have JDK installed in /opt.
Then add the following lines to .bashrc

export JAVA_HOME=/opt/jdk1.6.0_32
Old 12-04-2012, 09:50 AM   #3
Registered: Aug 2011
Location: Chennai,India
Distribution: Redhat,Centos,Ubuntu,Dedian
Posts: 558
Blog Entries: 5

Rep: Reputation: Disabled
cd /opt/prod/java/jdk-6u24-linux-i586.bin

Install jdk file


#alternatives --install /usr/bin/java java /opt/prod/java/jdk1.6.0_24/bin/java 1

#alternatives --config java -Select installed java path java path

#java -version --> Check whether java path is enabled

$ vi ~/.bash_profile

export JAVA_HOME=/opt/prod/java/jdk1.6.0_24/bin/java

export PATH=$PATH:/opt/prod/java/jdk1.6.0_24/bin/java

To view Java_HOME path

$ echo $JAVA_HOME
$ echo $PATH

Last edited by jsaravana87; 12-04-2012 at 09:53 AM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Set environment variable path Mohammed Zia Linux - Newbie 2 07-14-2012 12:27 AM
How to set the PATH environment variable? red roses Linux - Newbie 4 04-25-2011 11:00 AM
How To Install Java on LINUX and set the path variable ytd Linux - Newbie 1 10-01-2010 04:36 AM
Cannot correctly set up the PATH environment variable Centos dralexpe Linux - Software 7 05-31-2008 12:23 AM
How to set PATH How do I set PATH environment variable? Tranquil Linux - Newbie 3 11-02-2003 03:52 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:01 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration