Solved

want to set path variable in fedora

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Strange html entity encoding by tidy 14 68
Problem logging tar errors 11 35
Problem to start Neon 20 49
Sendmail STARTTLS error 37 38
If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
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.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

762 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

7 Experts available now in Live!

Get 1:1 Help Now