Solved

want to set path variable in fedora

Posted on 2004-08-14
5
8,708 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

In my business, I use the LTS (Long Term Support) versions of Linux. My workstations do real work, and so I rarely have the patience to deal with silly problems caused by an upgraded kernel that had experimental software on it to begin with from a r…
Fine Tune your automatic Updates for Ubuntu / Debian
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

930 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now