aba
unread,Jul 19, 2008, 2:03:19 PM7/19/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to orangescape.dimension
If you search around the net on how to set JAVA_HOME or any other
environmental variable, you would find some like this,
export JAVA_HOME=/path/to/jdk/installation/folder.
what this does is temporarily creates the JAVA_HOME variable and sets
the value to it / overrides the originally set value for JAVA_HOME
variable. To permanently set the environment variable do the
following.
Note: The following is stated with the assumption that you have JDK
installed in /usr/local/jdk<version number>
1) go to the terminal. If you are fortunate to have GUI then go to
the home directory of currently logged in user and enable view hidden
files option from the menu (if using GNOME press Ctrl+H).
2) open the file .bash_profile or .bashrc (whichever file is there in
the home directory) in vi(if terminal) or a text editor.
3) find the section which looks similar to either of the two formats
-------------------------------------------------
PATH="/usr/local":......:"${PATH}
export PATH
or
export PATH="/usr/local":.....:"${PATH}"
--------------------------------------------------------
4) before this line add the following
----------------------------------------------------------
export JAVA_HOME=/usr/local/jdk1.6.0_05
----------------------------------------------------------
use your appropriate path, i had installed JDK in "/usr/local/
jdk1.6.0_05", you have to give the path where you have installed
JDK...
5) save and close the file, and logoff and login for the setting to
take effect.
Note: You can check what value has been set to JAVA_HOME (if
previously set) by use the echo command
for ex:
anbarasan@Phoniex:~$ echo $JAVA_HOME
/usr/local/jdk1.6.0_05
Note: If you want to add the java to path variable also, change the
path variable value like this.
---------------------------
original path value
--------------------------
anbarasan@Phoniex:~$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games
------------------------
my .bashrc entry
------------------------
# Setting JAVA_HOME and ANT_HOME variables
export JAVA_HOME=/usr/local/jdk1.6.0_05
export ANT_HOME=/usr/local/ant
#adding java and ant to path variable
PATH="${JAVA_HOME}/bin":"${ANT_HOME}/bin":"/usr/local/SQuirreL":"$
{PATH}"
export PATH
----------------------------
modified path value
----------------------------
anbarasan@Phoniex:~$ echo $PATH
/usr/local/jdk1.6.0_05/bin:/usr/local/ant/bin:/usr/local/SQuirreL:/usr/
local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games