[opensuse] Editting PATH variable
The system is x86_64 openSuSE v10.2. Previously, it contained jre v1.4.2, and PATH contained the string . Recently I updated to jre v1.6.0, and the new PATH string should be (but it remains as before, because I am not clear on how to change it). But then I decided that what I really need is a JDK, so I installed jdk v1.6.0_02. The installer suggested installing in <~/jdk1.6.0_02/bin>, and I accepted this. -- I am not uncomfortable with the JDK in the user directory, with a JRE available for anyone else, so the new phrase in PATH should be , and the JDK equivalent should be in the user's PATH. The sources I have found from a Google search indicate that I should change the global PATH variable by editing the file /etc/profile. But when I opened (as root) that file, and searched for the string "jre" to find the place to edit, I was unable to find it. Moreover, there is a warning at the top of that file telling me that changes in the profile may not survive a system update, which is discouraging. The fact that "jre" is not found at all is inexplicable to me, since "jre" is known to be contained in the PATH, and I would like to understand why it isn't present. The 'Net offers much advice on how to add a directory to PATH by the sequence: PATH = $PATH:<new string> export PATH but seems to ignore completely the question of changing existing directories. How to go about this? -- Stan Goodman Qiryat Tiv'on Israel Idiotic commercials heard on CNN, #3: "It's funny how airlines always focus on the big things. To me, it's the little things that are important." -- for Scandinavian Airlines -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Stan Goodman wrote:
The system is x86_64 openSuSE v10.2.
Previously, it contained jre v1.4.2, and PATH contained the string .
Recently I updated to jre v1.6.0, and the new PATH string should be (but it remains as before, because I am not clear on how to change it).
But then I decided that what I really need is a JDK, so I installed jdk v1.6.0_02. The installer suggested installing in <~/jdk1.6.0_02/bin>, and I accepted this. -- I am not uncomfortable with the JDK in the user directory, with a JRE available for anyone else, so the new phrase in PATH should be , and the JDK equivalent should be in the user's PATH.
The sources I have found from a Google search indicate that I should change the global PATH variable by editing the file /etc/profile. But when I opened (as root) that file, and searched for the string "jre" to find the place to edit, I was unable to find it. Moreover, there is a warning at the top of that file telling me that changes in the profile may not survive a system update, which is discouraging. The fact that "jre" is not found at all is inexplicable to me, since "jre" is known to be contained in the PATH, and I would like to understand why it isn't present.
The 'Net offers much advice on how to add a directory to PATH by the sequence:
PATH = $PATH:<new string> export PATH
but seems to ignore completely the question of changing existing directories. How to go about this?
The first thing is that Java is a bit special about it handles these things, the system path is usually irrelevant to java. JAVA_HOME is important... as are a few other variables.... Look at the following /etc/java/java.conf /etc/profile.d/alljava.sh to get an idea of what is happening. I would recommend using the SuSE rpms (particularly on x64 systems) as things are a bit non standard (in a rather elegant manner). - -- ============================================================================== I have always wished that my computer would be as easy to use as my telephone. My wish has come true. I no longer know how to use my telephone. Bjarne Stroustrup ============================================================================== -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iD8DBQFG4V5yasN0sSnLmgIRAqEuAKDjkjJ1Pz2PeX3wwoO9se/Og0JEMACfX6er kWyj67yDymRh4JclR6ujmd0= =kM38 -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
** Reply to message from G T Smith
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Stan Goodman wrote:
The system is x86_64 openSuSE v10.2.
Previously, it contained jre v1.4.2, and PATH contained the string .
Recently I updated to jre v1.6.0, and the new PATH string should be (but it remains as before, because I am not clear on how to change it).
But then I decided that what I really need is a JDK, so I installed jdk v1.6.0_02. The installer suggested installing in <~/jdk1.6.0_02/bin>, and I accepted this. -- I am not uncomfortable with the JDK in the user directory, with a JRE available for anyone else, so the new phrase in PATH should be , and the JDK equivalent should be in the user's PATH.
The sources I have found from a Google search indicate that I should change the global PATH variable by editing the file /etc/profile. But when I opened (as root) that file, and searched for the string "jre" to find the place to edit, I was unable to find it. Moreover, there is a warning at the top of that file telling me that changes in the profile may not survive a system update, which is discouraging. The fact that "jre" is not found at all is inexplicable to me, since "jre" is known to be contained in the PATH, and I would like to understand why it isn't present.
The 'Net offers much advice on how to add a directory to PATH by the sequence:
PATH = $PATH:<new string> export PATH
but seems to ignore completely the question of changing existing directories. How to go about this?
The first thing is that Java is a bit special about it handles these things, the system path is usually irrelevant to java. JAVA_HOME is important... as are a few other variables...
So far, I have been using full pathname to call java 1.6.0 to start java
applications (because PATH isn't correct for this version, as I said). I would,
however, like to make the needed correction, if for no other reason than to
shorten the command line in the scripts that call these apps. But I take your
point -- the other variables are important.
The jre that I installed was indeed installed through YaST from an rpm package:
Look at the following
/etc/java/java.conf /etc/profile.d/alljava.sh
to get an idea of what is happening.
I would recommend using the SuSE rpms (particularly on x64 systems) as things are a bit non standard (in a rather elegant manner).
-- Stan Goodman Qiryat Tiv'on Israel REAL similes/metaphors by high school students; #19: The plan was simple, like my brother-in-law Phil. But unlike Phil, this plan just might work. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Stan Goodman wrote:
** Reply to message from G T Smith
on Fri, 07 Sep 2007 15:21:38 +0100 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Stan Goodman wrote:
The system is x86_64 openSuSE v10.2.
Previously, it contained jre v1.4.2, and PATH contained the string .
<snip>
but seems to ignore completely the question of changing existing directories. How to go about this?
The first thing is that Java is a bit special about it handles these things, the system path is usually irrelevant to java. JAVA_HOME is important... as are a few other variables...
So far, I have been using full pathname to call java 1.6.0 to start java applications (because PATH isn't correct for this version, as I said). I would, however, like to make the needed correction, if for no other reason than to shorten the command line in the scripts that call these apps. But I take your point -- the other variables are important.
The jre that I installed was indeed installed through YaST from an rpm package:
, because I find it in YaST's Software Management tool. I do not find the jdk; what is the method I need to use for removing it properly, after which I will try to find the appropriate rpm package? Although I removed the jre v1.4.2 package using YaST, I now find the following two installed packages in Software Management:
jre-1_4_2-gci-compat jre-1_4_2-gci-compat.32bit
I don't recognize these; shall I remove them, since there is no corresponding jre?
Look at the following
/etc/java/java.conf /etc/profile.d/alljava.sh
to get an idea of what is happening.
I would recommend using the SuSE rpms (particularly on x64 systems) as things are a bit non standard (in a rather elegant manner).
Firstly with the SuSE Java installation I would have expected a symbolic link from /usr/bin/java to /etc/alternatives/java for later configurations (this is a link into the the java installation tree. This rather hides some of the messy version numbering bits so is largely version tolerant...)... or some such.. The other two are hangovers from 1.4.2 which was only available in a 32bit form... I do not remember seeing any java stuff in the system path in the past on SuSE but I tend to work with Eclipse so this usually well hidden... Java is supposed to be OS agnostic so it carrys around it own environment. ... - -- ============================================================================== I have always wished that my computer would be as easy to use as my telephone. My wish has come true. I no longer know how to use my telephone. Bjarne Stroustrup ============================================================================== -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iD8DBQFG4aYXasN0sSnLmgIRAhpdAKCDVVGNKoNTgGFbXJSnnmpIfcq7BwCfaL41 uewfKh68ZWiTk+IGBh/6BAE= =ixvf -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
** Reply to message from G T Smith
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Stan Goodman wrote:
** Reply to message from G T Smith
on Fri, 07 Sep 2007 15:21:38 +0100 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Stan Goodman wrote:
The system is x86_64 openSuSE v10.2.
Previously, it contained jre v1.4.2, and PATH contained the string .
<snip>
but seems to ignore completely the question of changing existing directories. How to go about this?
The first thing is that Java is a bit special about it handles these things, the system path is usually irrelevant to java. JAVA_HOME is important... as are a few other variables...
So far, I have been using full pathname to call java 1.6.0 to start java applications (because PATH isn't correct for this version, as I said). I would, however, like to make the needed correction, if for no other reason than to shorten the command line in the scripts that call these apps. But I take your point -- the other variables are important.
The jre that I installed was indeed installed through YaST from an rpm package:
, because I find it in YaST's Software Management tool. I do not find the jdk; what is the method I need to use for removing it properly, after which I will try to find the appropriate rpm package? Although I removed the jre v1.4.2 package using YaST, I now find the following two installed packages in Software Management:
jre-1_4_2-gci-compat jre-1_4_2-gci-compat.32bit
I don't recognize these; shall I remove them, since there is no corresponding jre?
Look at the following
/etc/java/java.conf /etc/profile.d/alljava.sh
to get an idea of what is happening.
I would recommend using the SuSE rpms (particularly on x64 systems) as things are a bit non standard (in a rather elegant manner).
Firstly with the SuSE Java installation I would have expected a symbolic link from /usr/bin/java to /etc/alternatives/java for later configurations (this is a link into the the java installation tree. This rather hides some of the messy version numbering bits so is largely version tolerant...)... or some such..
The other two are hangovers from 1.4.2 which was only available in a 32bit form...
Then I gather that I may remove them, as seemed reasonable.
I do not remember seeing any java stuff in the system path in the past on SuSE but I tend to work with Eclipse so this usually well hidden... Java is supposed to be OS agnostic so it carrys around it own environment. ...
But at the moment, there are three questions on the practical level, of which two remain problems: 1) The jre was installed where it is by rpm without asking me; it is easy to remove if I choose to do so; this is not a problem. 2) The jdk was installed (foolishly, without thinking) in my home directory, and I really want to remove, and to do so in such a way as not to make more trouble for myself. The Software Management tool is of no help for this. How should I go about removing it, so that I can reinstall from an rpm package? 3) It is possible that the jdk installed by rpm will straighten out the PATH question automatically. I would still like to know how one can revise or remove a directory (i.e. the string between two colons) in the PATH variable. Can someone tell me that? -- Stan Goodman Qiryat Tiv'on Israel Did Ken Starr suffer from Subpoenis Envy? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Stan Goodman wrote:
** Reply to message from G T Smith
on Fri, 07 Sep 2007 20:27:20 +0100 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
<snip>
But at the moment, there are three questions on the practical level, of which two remain problems:
1) The jre was installed where it is by rpm without asking me; it is easy to remove if I choose to do so; this is not a problem.
True..
2) The jdk was installed (foolishly, without thinking) in my home directory, and I really want to remove, and to do so in such a way as not to make more trouble for myself. The Software Management tool is of no help for this. How should I go about removing it, so that I can reinstall from an rpm package?
I am a bit bemused by this... the SuSE install usually puts the JDK in the Java installation tree... Did you install with YaST or with the rpm installation tools? Yast should give you the option to remove it if it was installed via Yast...
3) It is possible that the jdk installed by rpm will straighten out the PATH question automatically. I would still like to know how one can revise or remove a directory (i.e. the string between two colons) in the PATH variable. Can someone tell me that?
Here you are talking about modifying the bash profiles... Where you make the changes depends on whether you want the path to change globally or for a particular user, or on login. /etc/profile for system wide configuration ~/.bash_profile ~/.bash_login or ~/.profile) for user login ~/.bashrc for non login shells for a starter these are effectively scripts and some knowledge of BASH scripting is a good idea before attempting to modify these, (and read the BASH documentation). Getting this wrong could make life rather interesting :-) For Java use editing the PATH variable is NOT required... - -- ============================================================================== I have always wished that my computer would be as easy to use as my telephone. My wish has come true. I no longer know how to use my telephone. Bjarne Stroustrup ============================================================================== -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iD8DBQFG4b/HasN0sSnLmgIRAj0pAKCuKQW50IhrJ/22r0xTfrwIASk+mwCdEGCw XGhiHwFd+cQsnpUxxAPhvk8= =TflL -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
** Reply to message from G T Smith
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Stan Goodman wrote:
** Reply to message from G T Smith
on Fri, 07 Sep 2007 20:27:20 +0100 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
<snip>
But at the moment, there are three questions on the practical level, of which two remain problems:
1) The jre was installed where it is by rpm without asking me; it is easy to remove if I choose to do so; this is not a problem.
True..
2) The jdk was installed (foolishly, without thinking) in my home directory, and I really want to remove, and to do so in such a way as not to make more trouble for myself. The Software Management tool is of no help for this. How should I go about removing it, so that I can reinstall from an rpm package?
I am a bit bemused by this... the SuSE install usually puts the JDK in the Java installation tree... Did you install with YaST or with the rpm installation tools? Yast should give you the option to remove it if it was installed via Yast...
No. The "foolishly, without thinking" was that I did NOT install with YaST; if I had, the answer to (2) would have been the same as for (1), and no problem would exist. What is a safe way to remove the jdk, given that YaST is of no help?
3) It is possible that the jdk installed by rpm will straighten out the PATH question automatically. I would still like to know how one can revise or remove a directory (i.e. the string between two colons) in the PATH variable. Can someone tell me that?
Here you are talking about modifying the bash profiles... Where you make the changes depends on whether you want the path to change globally or for a particular user, or on login.
I would like to understand both the global and user-only cases. For each of these, I am most interested in producing a permanent change that will survive reboot, so what you have called "on logon".
/etc/profile for system wide configuration ~/.bash_profile ~/.bash_login or ~/.profile) for user login ~/.bashrc for non login shells
For the user login case, one can use any of the three you mention? Are these aliases for a single file?
for a starter
these are effectively scripts and some knowledge of BASH scripting is a good idea before attempting to modify these, (and read the BASH documentation). Getting this wrong could make life rather interesting :-)
For Java use editing the PATH variable is NOT required...
As I have said, I am currently operating successfully with an incorrect PATH variable. But that means that I have to specify the full pathname for the <java> executable, whereas if the PATH were correct, I could just call it "java". There is no difference between Java and any other executable -- one either specifies full pathname, or needs to have a correct pointer in PATH.. I too am bemused. I think the insistence that the PATH is irrelevant comes because you are thinking of the various java apps one might be using, rather than the java executable. I am thinking of the latter alone, and PATH is convenient, if not necessary. -- Stan Goodman Qiryat Tiv'on Israel
From REAL answers on children's science examinations (#5): Q: What causes the tides in the oceans? A: The tides are a fight between the Earth and the Moon. All water tends to flow towards the moon, because there is no water on the moon, and nature hates a vacuum. I forget where the sun joins in this fight. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Friday 07 September 2007 15:13, Stan Goodman wrote:
...
As I have said, I am currently operating successfully with an incorrect PATH variable. But that means that I have to specify the full pathname for the <java> executable, whereas if the PATH were correct, I could just call it "java". There is no difference between Java and any other executable -- one either specifies full pathname, or needs to have a correct pointer in PATH..
I too am bemused. I think the insistence that the PATH is irrelevant comes because you are thinking of the various java apps one might be using, rather than the java executable. I am thinking of the latter alone, and PATH is convenient, if not necessary.
Have you consulted the manual page for "update-alternatives?" I believe it may offer you the control you require.
-- Stan Goodman
Randall Schulz -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Stan Goodman wrote:
** Reply to message from G T Smith
on Fri, 07 Sep 2007 22:16:55 +0100 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Stan Goodman wrote:
** Reply to message from G T Smith
on Fri, 07 Sep 2007 20:27:20 +0100 2) The jdk was installed (foolishly, without thinking) in my home directory,
<snip>
No. The "foolishly, without thinking" was that I did NOT install with YaST; if I had, the answer to (2) would have been the same as for (1), and no problem would exist. What is a safe way to remove the jdk, given that YaST is of no help?
Therefore I assume that you installed with rpm without running the SuSEconfig script ... uninstalling with rpm should remove the package without any problems... not knowing what you options you used to install I would refer to the rpm manpage for the appropriate options to uninstall... <snip>
Here you are talking about modifying the bash profiles... Where you make the changes depends on whether you want the path to change globally or for a particular user, or on login.
I would like to understand both the global and user-only cases. For each of these, I am most interested in producing a permanent change that will survive reboot, so what you have called "on logon".
/etc/profile for system wide configuration
This is the system wide profile... there are other scripts in profile.d that are used, it is called before...
~/.bash_profile ~/.bash_login or ~/.profile) for user login
(Actually, these are not aliases so much as alternates, the shell searches for these files in that order... a login shell is the initial login prompt shell)...Different distros do vary a bit on this.. or
~/.bashrc for non login shells
which is used for further instances of the shell. These are related to settings in /etc/sysconfig.. in most cases user modifications should placed in <profile>.local (read docs for more detail than really be given in an email). I will repeat it is not a good idea to make changes to these unless you have a good knowledge of bash/sh, if you do wish to experiment use a local settings in a test account. If your unfamiliar with Bash a good book is 'Learning the Bash Shell' by Newham and Rosenblatt. There is also a bash guide somewhere in the user documentation (cant for the life of me remember where should be at the moment)...
for a starter
these are effectively scripts and some knowledge of BASH scripting is a good idea before attempting to modify these, (and read the BASH documentation). Getting this wrong could make life rather interesting :-)
For Java use editing the PATH variable is NOT required...
As I have said, I am currently operating successfully with an incorrect PATH variable. But that means that I have to specify the full pathname for the
Once you have loaded the java instance it does not care.. If you have a close look at the bin directories you will come across links to things in other directories... The standard path finds the link and then executes the program.. simple... The SuSE rpm sets up this link ... There is Randalls interesting suggestion which I had not heard any references to before (which is something new to explore :-) ). If you really are worried about having the path include the location of the java directory then invoke java with a script that sets appropriate path changes then calls java ...
- -- ============================================================================== I have always wished that my computer would be as easy to use as my telephone. My wish has come true. I no longer know how to use my telephone. Bjarne Stroustrup ============================================================================== -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iD8DBQFG4eK4asN0sSnLmgIRAsdzAJ90rbsZWxs0ZWK1qYzjutYlmxaVTQCg2jRd ZKWueZ/1xmiNy16l8jBof70= =Ufya -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 09/08/2007 06:13 AM, Stan Goodman wrote:
I too am bemused. I think the insistence that the PATH is irrelevant comes because you are thinking of the various java apps one might be using, rather than the java executable. I am thinking of the latter alone, and PATH is convenient, if not necessary. I believe you are confusing PATH with the links SUSE uses for java. Please check, in a console as root, update-alternatives --help, which will give you some good help in understanding the equivalent of PATH for java. Try update-alternatives --display java to get an idea of all that is involved. You had problems because you installed a fedora rpm instead of a SUSE.
-- Joe Morris Registered Linux user 231871 running openSUSE 10.2 x86_64 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
** Reply to message from G T Smith
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Stan Goodman wrote:
The system is x86_64 openSuSE v10.2.
Previously, it contained jre v1.4.2, and PATH contained the string .
Recently I updated to jre v1.6.0, and the new PATH string should be (but it remains as before, because I am not clear on how to change it).
But then I decided that what I really need is a JDK, so I installed jdk v1.6.0_02. The installer suggested installing in <~/jdk1.6.0_02/bin>, and I accepted this. -- I am not uncomfortable with the JDK in the user directory, with a JRE available for anyone else, so the new phrase in PATH should be , and the JDK equivalent should be in the user's PATH.
The sources I have found from a Google search indicate that I should change the global PATH variable by editing the file /etc/profile. But when I opened (as root) that file, and searched for the string "jre" to find the place to edit, I was unable to find it. Moreover, there is a warning at the top of that file telling me that changes in the profile may not survive a system update, which is discouraging. The fact that "jre" is not found at all is inexplicable to me, since "jre" is known to be contained in the PATH, and I would like to understand why it isn't present.
The 'Net offers much advice on how to add a directory to PATH by the sequence:
PATH = $PATH:<new string> export PATH
but seems to ignore completely the question of changing existing directories. How to go about this?
The first thing is that Java is a bit special about it handles these things, the system path is usually irrelevant to java. JAVA_HOME is important... as are a few other variables...
So far, I have been using full pathname to call java 1.6.0 to start java
applications (because PATH isn't correct for this version, as I said). I would,
however, like to make the needed correction, if for no other reason than to
shorten the command line in the scripts that call these apps. But I take your
point -- the other variables are important.
The jre that I installed was indeed installed through YaST from an rpm package:
Look at the following
/etc/java/java.conf /etc/profile.d/alljava.sh
to get an idea of what is happening.
I would recommend using the SuSE rpms (particularly on x64 systems) as things are a bit non standard (in a rather elegant manner).
-- Stan Goodman Qiryat Tiv'on Israel REAL similes/metaphors by high school students; #19: The plan was simple, like my brother-in-law Phil. But unlike Phil, this plan just might work. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (4)
-
G T Smith
-
Joe Morris (NTM)
-
Randall R Schulz
-
Stan Goodman