LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-03-2007, 03:58 AM   #1
benhur99ph
LQ Newbie
 
Registered: Oct 2007
Posts: 6

Rep: Reputation: 0
How to modify .bash_profile to include Java path?


Hello? I'm a new Linux user and I use rPath Linux. I'm trying to install Squirrel SQL 2.5 on my machine and I'm following the instructions that I found on the net.

It instructs me to modify my .bash_profile and include the path for my java.

Can anyone here please give me detailed instructions on how to do that. Thanks in advance.
 
Old 10-03-2007, 03:59 AM   #2
benhur99ph
LQ Newbie
 
Registered: Oct 2007
Posts: 6

Original Poster
Rep: Reputation: 0
site link

By the way, here is the link to the website that I mentioned earlier:

http://www.madirish.net/?article=116

thanks again.
 
Old 10-03-2007, 06:39 PM   #3
bmarx
Member
 
Registered: Dec 2004
Distribution: Slackware, Arch, FreeBSD
Posts: 202

Rep: Reputation: 34
Did you try adding PATH=$PATH:/usr/java/j2sdk1.4.2_01/bin to your .bash_profile? The website you point to is very straightforward:

Note that your sdk version might be different from mine. You basically want to add the directory where you find your 'java' and 'javac' executables. When you log back in you can check to see if the $PATH variable got updated correctly by opening a command line and typing in 'javac -v' which should throw an error about a bad flag. If you get a 'command not found' error or something else then your computer isn't finding the java program where its looking for it and you've got to do some more updates

If you cannot afford to logout and log back in:

~$export PATH=$PATH:/usr/java/j2sdk1.4.2_01/bin
 
Old 10-03-2007, 08:00 PM   #4
benhur99ph
LQ Newbie
 
Registered: Oct 2007
Posts: 6

Original Poster
Rep: Reputation: 0
Talking yes, but

Yes I agree that the website is very straightforward but being the noob that I am, I do not know how to modify the .bash_profile. It says there that I should add some line to my .bash_profile and I don't even know where it is.

Thanks for any help you guys can give me.
 
Old 10-03-2007, 08:40 PM   #5
bmarx
Member
 
Registered: Dec 2004
Distribution: Slackware, Arch, FreeBSD
Posts: 202

Rep: Reputation: 34
Ah. My apologies. The .bash_profile file should be located in your home directory. To get there, open up a console/terminal (command line) and do a "cd $HOME". This will move you to your home directory, which is at /home/<username>. From there, you can do a: user@localhost~$echo "export PATH=$PATH:/path/to/java" >> .bash_profile, which should append the line to the .bash_profile file. If neither of them are there, you can create them with "touch <filename>". Be sure to do a "ls -a" before though to view all of the files in the directory and make sure you are not overwriting anything.

you can also just execute the command ~$export PATH=$PATH:/path/to/java from the command line to have the settings apply right away. Do a ~$echo $PATH to see what is currently in your path and to verify.

you also might want to read up a little on the linux filesystem hierarchy and common bash commands to make your life a little bit easier. http://tldp.org/ is a good place to start.
 
Old 10-03-2007, 08:45 PM   #6
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
First check if you have ~/.profile or ~/.bash_login instead and if one of them exists you can edit those instead.

Look in the "info bash" manual and search for ".bash_profile". It explains that bash will look for ~/.bash_profile first, and if it doesn't exist will look for ~/.bash_login second and lastly ~/.profile. If you add a new ~/.bash_profile, when you already have a ~/.profile file, the commands in ~/.profile won't be executed unless your ~./bashrc or ~/.bash_profile commands explicitely run it themselves.
 
Old 10-04-2007, 04:03 AM   #7
benhur99ph
LQ Newbie
 
Registered: Oct 2007
Posts: 6

Original Poster
Rep: Reputation: 0
Talking problem solved

Thank to all that replied. I solved my problem. I used the command

vi .bash_profile

it opened up my bash_profile file and I modified it from there.

Thanks again.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding a Path to .bash_profile nexisrocks Linux - Newbie 4 06-20-2007 07:54 PM
Adding Java to my path in the .bash_profile file .... jmax24 Linux - General 5 04-20-2004 01:14 PM
How to modify the library path variable?modify the Electronkz Linux - Newbie 1 04-13-2004 06:18 AM
kde3.2 $PATH and .bash_profile easywebdev Slackware 2 03-29-2004 04:42 PM
.bash_profile & path Syncrm Linux - General 11 01-30-2002 01:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:34 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
Open Source Consulting | Domain Registration