LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-13-2005, 12:37 AM   #1
stasch
LQ Newbie
 
Registered: Apr 2005
Location: south africa
Distribution: suse 9.3
Posts: 6

Rep: Reputation: 0
setting a path


i have just installed java jdk 1.5 on linux suse 9.1. the problem is that i am used to use the javac command to compile my java files and when i use it now i get an error stating that the javac command cannot be found.

a friend told me that he had a similar problem in windows and that he had to set a path to the java / bin directory. how can i do this in linux? please help!!
regards
 
Old 04-13-2005, 12:48 AM   #2
kencaz
Senior Member
 
Registered: Mar 2005
Location: Las Vegas, NV
Distribution: Mandriva Slackware FreeBSD
Posts: 1,468

Rep: Reputation: 48
Lotsa good info here:
Look for "Setting the PATH for Linux"
http://anchorpointbooks.com/java/pathsetting.html

KC
 
Old 04-13-2005, 12:52 AM   #3
tim1235
Member
 
Registered: Aug 2004
Location: Melbourne, Australia
Distribution: fc5/Gentoo
Posts: 57

Rep: Reputation: 15
You can set this in your .profile found in your home directory (it may be .bash_profile?)
(Unless you want it available to all users then you can set it in /etc/profile)

There should be a variable called PATH,

PATH=/usr/bin:/usr/local/bin:/usr/local/bin/jvm/java1.5/bin

You should add you java path similar to above but point it to your java path,


Don't forget to update your environment

$source ~/.profile
 
Old 04-13-2005, 01:32 AM   #4
scuzzman
Senior Member
 
Registered: May 2004
Location: Hilliard, Ohio, USA
Distribution: Slackware, Kubuntu
Posts: 1,851

Rep: Reputation: 47
The command you'll want to use, so you don't overwrite your existing $PATH is this:
Code:
export PATH=$PATH:/usr/local/bin/jvm/java1.5/bin
 
Old 05-28-2005, 03:45 AM   #5
redhatrosh
Member
 
Registered: May 2004
Location: Student of University of Mumbai, Maharastra State, India
Distribution: Redhat Linux 9.0, Knoppix LIVE CD, Ubuntu Live CD, Kubuntu Live CD
Posts: 483

Rep: Reputation: 30
hey..all.. I know I am replying to this...after a long time....

But there's one thing....
There's no specific thing CALLED PATH in /etc/profile....
its a file with some code....


What I did is this....

first wrote these two sentences in /etc/profile
Code:
PATH="$PATH:/usr/java/j2sdk1.4.2_08/bin:" 
export PATH
then as said by tim1235, I wrote

Code:
source /etc/profile
so..now I have it in my PATH variable......

I hope this wud help ppl who wud search ...for this...
 
  


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
Setting the path powerlifter450 Linux - Software 18 07-05-2006 10:46 AM
setting a path mjkramer Linux - Newbie 8 11-18-2004 07:35 PM
Setting the path Milkman00 Linux - General 2 07-26-2002 08:44 AM
setting PATH tda Linux - Newbie 1 04-29-2002 12:54 PM
Setting up PATH Sonny Linux - Newbie 4 01-28-2002 01:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:07 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