Advertisement

Changing my PATH

Started by December 23, 2002 02:30 AM
1 comment, last by Dauntless 21 years, 10 months ago
I have Mandrake 9.0 setup (waiting for the real release of Gentoo 1.4) but I ran into a problem with Java. I managed to the JDK 1.4.1 installed, but when I open up e-term and type in: java --version I'm greeted with 1.07 Kaffee version. Now, when I installed the JDK I put su'd to root, and I installed it in /home/sean. I think by default it put it in /home/sean/s1studio-1.4.1 (or something like that). Now, if I cd to that directory and type in java --version, I get the correct response of version 1.4.1 Realizing that the JDK installed didn't change the environment variable for PATH, I typed in set and looked for my directory of /home/sean/s1studio-1.4.1/bin somewhere in the list. Sure enough, I didn't see it in there. So here's the stupid question of the day, where is the original java and how do I override it so that when I call anything from the /home/sean/s1studio-1.4.1/bin directory, it's actually calling those executables? Even if I just do something like: set PATH=:/home/sean/s1studio-1.4.1/bin If I call javac HelloWorld.class will it use the javac from ~/s1studio-1.4.1/bin like I want it to, and not the java 1.07 kaffee version (wherever that's coming from)? As another quick question, I realize that putting it in /home/sean isn't really a good idea, so what's a better alternative? Should I create some kind of folder that all users can have access too? I'm afraid of putting stuff in /usr/local or /usr/opt since I have no idea what gets put in there. [edited by - Dauntless on December 23, 2002 3:33:03 AM]
The world has achieved brilliance without wisdom, power without conscience. Ours is a world of nuclear giants and ethical infants. We know more about war than we know about peace, more about killing than we know about living. We have grasped the mystery of the atom and rejected the Sermon on the Mount." - General Omar Bradley
To set the path, in bash, type ''export PATH=/home/sean/blah:$PATH''. Or put it in ~/.bashrc or ~/.bash_profile (the files are used at different times, but I can''t remeber which is which).

/usr/local or /opt is the ideal place to put it. The distro isn''t supposed to touch /usr/local, it''s purely for packages that aren''t part of the distro. And, everything in /opt is supposed to have it''s own directory, so it shouldn''t matter if you put anything there. It''s convienent for packages with lots of files that would polute /usr/local.
Advertisement
When you install Java via a rpm, it''ll install to the /usr/java/j2sdk1.XXXXX directory. Thus, I think that would be the ideal place to put it, if you didn''t install it via rpm.

If you want to set the PATH globally, edit /etc/profile. Being fairly new to Linux, I don''t know if that''s a great idea, but I can''t see anything wrong with it.
==========================================In a team, you either lead, follow or GET OUT OF THE WAY.

This topic is closed to new replies.

Advertisement