Solved

want to set path variable in fedora

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

This article will explain how to establish a SSH connection to Ubuntu through the firewall and using a different port other then 22. I have set up a Ubuntu virtual machine in Virtualbox and I am running a Windows 7 workstation. From the Ubuntu vi…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

732 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