Solved

want to set path variable in fedora

Posted on 2004-08-14
5
8,718 Views
Last Modified: 2013-12-06
hi i am using fedora linux and i would like to set a path for my java and my ant program

no i tried

export JAVA_HOME=/usr/java/j2sdk1.4.0_01
export ANT_HOME=/opt/jakarta-ant-1.4.1
export PATH=${PATH}:${JAVA_HOME}/bin:${ANT_HOME}/bin:

that worked only for that terminal session
i want it to work all the time

please i want to set the path variable so that even if i reboot the system that static path is still there emnaing

java command  would work


thanks
0
Comment
Question by:zgeorge_2
5 Comments
 
LVL 6

Accepted Solution

by:
de2Zotjes earned 68 total points
ID: 11800911
edit the file /etc/profile

This file is executed every time a user logs on to the computer.

PS you can the sequence above, or you can use the pathmunge function, the effect will be the same...
0
 
LVL 23

Assisted Solution

by:Mysidia
Mysidia earned 66 total points
ID: 11801283
I would create an /etc/profile.d/java.sh

Paste those lines into it
and  chmod 755 /etc/profile.d/java.sh

and also make an  /etc/profile.d/java.csh with the lines:

setenv JAVA_HOME /usr/java/j2sdk1.4.0_01
setenv ANT_HOME /opt/jakarta-ant-1.4.1
set path = ( ${JAVA_HOME}/bin ${ANT_HOME}/bin $path )

chmod 755 /etc/profile.d/java.csh  (as well)

That way the variables can be setup for both shells (if you use both)
and the /etc/profile script is left pristine  which may be nice when you upgrade later
0
 
LVL 1

Assisted Solution

by:chikkala_cnu
chikkala_cnu earned 66 total points
ID: 11838288
Add following lines to your .bash_profile

JAVA_HOME=/usr/java/j2sdk1.4.0_01
ANT_HOME=/opt/jakarta-ant-1.4.1
PATH=${PATH}:${JAVA_HOME}/bin:${ANT_HOME}/bin:

export PATH

cnu...
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This document is written for Red Hat Enterprise Linux AS release 4 and ORACLE 10g.  Earlier releases can be installed using this document as well however there are some additional steps for packages to be installed see Metalink. Disclaimer: I hav…
Fine Tune your automatic Updates for Ubuntu / Debian
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question