LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   J2SE - Enviromental Variables (https://www.linuxquestions.org/questions/linux-newbie-8/j2se-enviromental-variables-637198/)

Maha1980 04-22-2008 11:12 PM

J2SE - Enviromental Variables
 
I installed the J2SE - SDK on Ubuntu,
How do I set the Enviromental Variables?

gilead 04-22-2008 11:36 PM

In your ~/.bash_profile you can add an entry for JAVA_HOME and you can modify your PATH. For example:
Code:

export JAVA_HOME=/usr/local/jdk
export PATH=$PATH:$JAVA_HOME/bin

The ~/.bash_profile file can be edited with any text editor.

Maha1980 04-23-2008 05:05 PM

where can i find bash_profile?
:s
i am a newbie :D

jay73 04-23-2008 06:57 PM

In your home directory, it is a hidden file so you'll have to make your file manager display hidden files.

Which distro did you install? You may need to do more than just setting the path.

Maha1980 04-25-2008 11:36 PM

what's a distro?

duryodhan 04-26-2008 12:22 AM

Quote:

what's a distro?
http://en.wikipedia.org/wiki/Linux_distribution
http://en.wikipedia.org/wiki/BASH#Startup_scripts

ufmale 04-26-2008 12:40 AM

Once logon, type

$cd

Now, you are in your home dir, then type

$vi ./bash_profile

Then add following line to the file

export JAVA_HOME=/usr/local/jdk
export PATH=$PATH:$JAVA_HOME/bin

jay73 04-26-2008 12:51 AM

There shouldn't be a bash_profile in Ubuntu. It uses .profile instead (and it installs its JDK to /usr/lib/jvm, not to /usr/local).


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