LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 12-04-2012, 05:05 AM   #1
dushyantgohil
Member
 
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, 05:30 AM   #2
kedarp
Member
 
Registered: Jul 2012
Distribution: Ubuntu
Posts: 198
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
PATH=.:$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH
 
Old 12-04-2012, 08:50 AM   #3
jsaravana87
Member
 
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

./jdk-6u24-linux-i586.bin


Configure
#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 08:53 AM.
 
  


Reply



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-13-2012 11:27 PM
How to set the PATH environment variable? red roses Linux - Newbie 4 04-25-2011 10:00 AM
How To Install Java on LINUX and set the path variable ytd Linux - Newbie 1 10-01-2010 03:36 AM
Cannot correctly set up the PATH environment variable Centos dralexpe Linux - Software 7 05-30-2008 11:23 PM
How to set PATH How do I set PATH environment variable? Tranquil Linux - Newbie 3 11-02-2003 02:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

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