Adding Java to PATH [Was: Export]

Bevan C. Bennett bevan at fulcrummicro.com
Mon Jan 12 19:43:11 UTC 2004


J.L. Coenders wrote:
> Hi all,
> Probably a stupid question, but to let my Java Runtime work, I have to 
> 
> export PATH=/usr/java/j2re1.4.1_04/bin:$PATH
> 
> After that it works, but now my problem:
> Linux work remember this and the next time I open a terminal window, I have to 
> type it again.
> Who can help me to let Linux remember this?

If you add the following files Java will be added to the path for all 
users when they log in (unless they override it), set the paths as 
appropriate for the version of java you installed:

[bevan at wallace ~]> cat /etc/profile.d/java.csh
if ( "${path}" !~ */usr/java/j2re1.4.2/bin* ) then
         set path = ( $path /usr/java/j2re1.4.2/bin )
endif

[bevan at wallace ~]> cat /etc/profile.d/java.sh
if ! echo ${PATH} | grep -q /usr/java/j2re1.4.2/bin ; then
         PATH=${PATH}:/usr/java/j2re1.4.2/bin
fi





More information about the fedora-list mailing list