hi,
I've installed JDK in Linux. As I'm a beginner to Linux, I need to how can I set path in bash shell so that all users can run java.
hi,
I've installed JDK in Linux. As I'm a beginner to Linux, I need to how can I set path in bash shell so that all users can run java.
Use export command as follows at command prompt:
You need to add command to /etc/profile or /home/you/.bash_profile so that PATH get set automatically after each reboot.Code:export PATH=$PATH:/usr/lib/j2sdk1.4-sun/bin
You can also add variable JAVA_HOME
Code:export JAVA_HOME=/usr/lib/j2sdk1.4-sun
All [Solved] threads are closed by mods / admin to avoid spam issues. See Howto mark a thread as [Solved]
I made this little script file that will change your path. it will add or remove a directory from your path. it is pathchanger. Here is a link
icecoolcorey.net
Hi. I'm a very very new linux user.
I am having the same problem of not being able to permanently adding a path to my bash profile.
I have already added the path to my .bashrc file, but don't seem to be able to restore the path after logging off from terminal.
This is how my .bashrc file looks like:
source ~/.bash_profile
export PATH=$PATH:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
export PATH=/Documents/Camino/camino/bin:$PATH
export MANPATH=//Documents/Camino/camino/man:$MANPATH
Where the program i want to run is stored in folder called Camino.
Please help! =)
Thanks
Hello,
first, this is my first post at nixCraft, but long time 'viewer'. Thanks.
OK, I edited my .bashrc file adding
to the end of the file. Everything else seems to be rem'd in the file.Code:PATH=/home/landis/programs/Java/:$PATH export PATH
Now, when I logout of KDE, logout of shell, login at prompt and type echo $PATH my 'new' path addition is echoed twice at the beginning of $PATH.. .
Why?
I did not add it anywhere else, nor was even One instance in path before I added it, that's why I added it.. : )
Спасибо,
Landis.
p.s., I also tried it without the line 'export'... same thing...
Hi,
can you once check PATH of Java in /etc/bashrc and .bashrc
you can use following command to check the same
PHP Code:awk '/PATH/&&/Java/' /etc/bashrc .bashrc
What OS are you using? Will all the users be using BASH? There are small differences between different distros.
ok, first try output:
hmm, same error as root (su).. Question.. do i need the ' (apostrophe) before and after /PATH/&&/Java/?Code:landis@linux-amd:~> awk '/PATH/&&/Java/' /etc/bashrc .bashrc awk: cmd. line:1: fatal: cannot open file `/etc/bashrc' for reading (No such file or directory) landis@linux-amd:~>
I used them. should I Not?
thanks,
Landis.
Last edited by Landis; 29th March 2012 at 09:53 PM.
additionally, in bash, is it required to declare Every directory? I mean, is 'path' Not recursive?
if I have /etc/bin that does Not cover directories Below it (sub directories)?
Спасибо,
Landis
There are currently 1 users browsing this thread. (0 members and 1 guests)