Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

want to set path variable in fedora

Posted on 2004-08-14
5
Medium Priority
?
8,743 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 6

Accepted Solution

by:
de2Zotjes earned 272 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 264 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 264 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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
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.
Suggested Courses

670 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