LinuxQuestions.org
Register a domain and help support LQ
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 04-23-2008, 12:12 AM   #1
Maha1980
LQ Newbie
 
Registered: Apr 2008
Posts: 8

Rep: Reputation: 0
J2SE - Enviromental Variables


I installed the J2SE - SDK on Ubuntu,
How do I set the Enviromental Variables?
 
Old 04-23-2008, 12:36 AM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,125

Rep: Reputation: 164Reputation: 164
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.
 
Old 04-23-2008, 06:05 PM   #3
Maha1980
LQ Newbie
 
Registered: Apr 2008
Posts: 8

Original Poster
Rep: Reputation: 0
where can i find bash_profile?
:s
i am a newbie
 
Old 04-23-2008, 07:57 PM   #4
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 130Reputation: 130
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.
 
Old 04-26-2008, 12:36 AM   #5
Maha1980
LQ Newbie
 
Registered: Apr 2008
Posts: 8

Original Poster
Rep: Reputation: 0
what's a distro?
 
Old 04-26-2008, 01:22 AM   #6
duryodhan
Senior Member
 
Registered: Oct 2006
Distribution: Slackware 12 Kernel 2.6.24 - probably upgraded by now
Posts: 1,054

Rep: Reputation: 46
Quote:
what's a distro?
http://en.wikipedia.org/wiki/Linux_distribution
http://en.wikipedia.org/wiki/BASH#Startup_scripts
 
Old 04-26-2008, 01:40 AM   #7
ufmale
Member
 
Registered: Feb 2007
Posts: 385

Rep: Reputation: 30
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
 
Old 04-26-2008, 01:51 AM   #8
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 130Reputation: 130
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).

Last edited by jay73; 04-26-2008 at 01:52 AM.
 
  


Reply


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
Setting up environment variables for j2se and j2ee on linux in .bashrc vitalstrike82 SUSE / openSUSE 1 03-30-2008 08:26 AM
LXer: System & enviromental variables in Linux LXer Syndicated Linux News 0 10-06-2007 09:42 AM
Enviromental Variables Serbulent Debian 2 04-28-2005 06:53 AM
How to set J2SE SDK environment variables on Fedora 2 jjunge Programming 2 07-28-2004 03:27 PM
Help with Enviromental Variables george3k Linux - General 4 09-14-2001 12:35 PM


All times are GMT -5. The time now is 01:45 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration