Discussion Locked

Can't make permanent changes to PATH

0 helpful
6 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I've got Redhat 7.1 installed on my laptop, and I've just installed the Java Development Kit (JDK) so I can do my university work.

1)
The trouble is, every time I want to use the applications from the JDK, I have to put in the whole path to the location of the files (unless I am in the correct directory).
I've tried to change my PATH statement using this command:
PATH=/usr/java/java1.3.1/bin:$PATH
This is fine as it lasts for the whole session. However, if I open another Xterm window or logout, the changes are not saved.
I'm new to Linux so I don't know what files I need to edit (or whatever else) in order to make the changes permanent.
I'm sure this is very simple, but I can't find a simple answer to such a simple question! Please help!

2)
How do I set things up so that I can mount a drive permanently? I can mount a drive lasting for one session, but if I log back in then I have to re-mount. How do I make this permanent?

3) Is there an equivalent to DOS's autoexec.batin Linux?

Many thanks in advance for your help.

Dan

6 replies

by cascom

To set your path statement permanently, edit
the /etc/profile file and add the line that
you are entering at the prompt somewhere near
the bottom of the file after the last path
statement, you will see the correct syntax
for the statement in the file as there are
already several path statements in there.
To permanently connect to another drive each
time the PC boots, add the appropriate entry
in the /etc/fstab file but BE CAREFUL, if you
get it wrong you can stop the PC from
booting.Check the "man" pages for fstab (man
fstab) so you understand what you are entering.

by cascom

Forgot to mention.....
No, there is no comparable file to DOS's
autoexec.bat. The configuration files are
many but mostly reside in the /etc directory.

Enjoy, it's a great OS...

This discussion is closed to new replies.