For Programmers: Free Programming Magazines  


Home > Archive > Java Help > January 2006 > Setting java path variable on Fedora Core 4









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Setting java path variable on Fedora Core 4
Jonie

2006-01-19, 7:08 pm


Hi all,
I need help for setting path variable for my Fedora Core 4. I just
installed java sdk 1.5.0_06 and followed the directions below.
It worked perfectly fine until I closed the terminal and re-opened
one. Then, i had to set up the path again to have my shell to find
javac
command.

I suspect that it's because i don't understand "Add to
$HOME/.bash_profile (below)". I would really appreciate it if anyone
help me out.

Thank you.

-----------------------------------------------
Set environment variables. (Add to $HOME/.bash_profile)

PATH=3D/usr/java/j2sdk1.4.0_03/bin:$PATH:$HOME/bin:./
export PATH
export JAVA_HOME=3D/usr/java/j2sdk1.4.0_03
export
CLASSPATH=3D/usr/java/j2sdk1.4.0_03/lib/tools.jar:/usr/java/j2sdk1.4.0_03/j=
re=AD/lib/rt.jar:./

-----------------------

Nigel Wade

2006-01-24, 7:58 am

Jonie wrote:

>
> Hi all,
> I need help for setting path variable for my Fedora Core 4. I just
> installed java sdk 1.5.0_06 and followed the directions below.
> It worked perfectly fine until I closed the terminal and re-opened
> one. Then, i had to set up the path again to have my shell to find
> javac
> command.
>
> I suspect that it's because i don't understand "Add to
> $HOME/.bash_profile (below)". I would really appreciate it if anyone
> help me out.
>
> Thank you.
>
> -----------------------------------------------
> Set environment variables. (Add to $HOME/.bash_profile)
>
> PATH=/usr/java/j2sdk1.4.0_03/bin:$PATH:$HOME/bin:./
> export PATH
> export JAVA_HOME=/usr/java/j2sdk1.4.0_03
> export
>

CLASSPATH=/usr/java/j2sdk1.4.0_03/lib/tools.jar:/usr/java/j2sdk1.4.0_03/jreÂ_/lib/rt.jar:./
>
> -----------------------


You do exactly what it says. You open the file $HOME/.bash_profile (the file
called .bash_profile in your home directory) in a text editor and add the above
lines to that file. Note that the directory (/usr/java/j2sdk1.4.0_03) will not
be the same on your system, you'll need to replace that with the actual
directory where Java is installed. Forget the CLASSPATH setting, you don't need
(or want) that, it will only get in the way. .bash_profile is only run when you
login, so to get it to execute you need to log out and back in again. You can
execute it without the logout/login by running the command '. ~/.bash_profile'
without the '', but otherwise exactly as written, including all the periods.

Alternatively, you could create a file called /etc/profile.d/java.sh and put the
commands in there so that all users will get the Java environment setup. Set
the permission on /etc/profile.d/java.sh so that all users can execute the file
by running the command 'chmod 755 /etc/profile.d/java.sh'.

--
Nigel Wade, System Administrator, Space Plasma Physics Group,
University of Leicester, Leicester, LE1 7RH, UK
E-mail : nmw@ion.le.ac.uk
Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555
Jonie

2006-01-24, 7:06 pm

Thank you much much. That works!

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com