LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   setting a path (https://www.linuxquestions.org/questions/linux-software-2/setting-a-path-312640/)

stasch 04-13-2005 12:37 AM

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

kencaz 04-13-2005 12:48 AM

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

KC

tim1235 04-13-2005 12:52 AM

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

scuzzman 04-13-2005 01:32 AM

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

redhatrosh 05-28-2005 03:45 AM

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...


All times are GMT -5. The time now is 07:08 PM.