Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am using Suse 10.0. I just found the JAVA version (1.4.2) on my computer out of date, and I want to install the latest version (1.6). I have several questions:
1. How to remove program in Linux?
In this case, how to remove JAVA 1.4.2 ( I couldn't find the directory where it is).
2. Do I have to remove JAVA 1.4.2 completely before installing JAVA 1.6?
3. When installing a new program (like to install JAVA 1.6 in this case) in Linux, how to make it accseeible to EVERY user? and how to make it accessible ONLY to the current user who install it?
4. How to set the PATH for
a: a program that is accessible to EVERY user?
b: a program that is only accessible to the current user who install it?
Please excuse my ignorance. I've used Windows too long, and the above problems really confuse me. Thanks a lot in advance!
You go to System > Yast > Software management, locate the software title in question , remove it, select the newer one, install it, done. Or you can simply leave 1.4.2 installed, it takes up some space but that's all it does.
Setting the path involves /etc/profile; just add:
export JAVA_HOME=/path/to/java folder
and then do: source /etc/profile
To make it available to only one user, you would put this information in the bashrc folder in their home directory instead.
Allowing or denying access to others is essentially a matter of setting permissions on applications and/or folders.
1. I tried YAST. I downloaded JAVA 1.6 (jre-6u2-linux-i586-rpm.bin and jre-6u2-linux-i586.bin) and try to import them to YAST. But I failed. Do I have to un-compress them first?
2. Rather than use YAST, can you suggest me a "command line" based method for both installation and uninstallation? (including what is the correct directory I should install to if the programm is to be used by EVERY user?)
3. I used vi editor trying to modify the /etc/profile, but it (the "profile") is recommended that I shouldn't do so. Is there any other way to set the PATH?
1. Well, the whole point of yast is that you don't need to download or import anything. jdk6 should be there already, on the list of available software. All you need to do is select the item and click on "Apply". If you find there isn't any jdk6 (as there wasn't yet when I left Suse behind some months ago), you can still use your downloaded bin file. Or use jre5 from yast instead - that is just as good as jre6 for all purposes. If you do need jre6, place the rpm.bin in your home directory, then use the command line and do:
chmod +x jre*
./jre*rpm.bin
rpm -ivh jre*rpm
2. see above; uninstalling can be done using rpm -e but using Yast and simply unselecting the item is a lot more convenient.
It doesn't matter where you install to, not in this case. Besides, the rpm -ivh will automaticaly install jre to either /opt or /usr/java.
3. Never mind what the /etc/profile says, just make sure you don't remove or overwrite anything. Btw, you need this:
export j2re_home=/path/to/jre
instead of what I said before - I assumed you would be installing jdk, not jre.
I installed jre-6u2-linux-i586-rpm. It is in directory "/usr/java". And I can see it in YAST shown as "jre", (and the old version "java-1_4_2-sun" is still there)
I havn't write the PATH yet. I checked the installation from Sun's website and it still says that I am using the old version ( "java-1_4_2-sun" ) and ask me to install the new version. Is this because the PATH?
Yes. Just put export J2RE=/usr/java/jre... in /etc/profile (assuming that it is jre that is in /usr/java - I'm not sure because I use the jdk instead of jre, then source /etc/profile. You can check from the command line like this:
echo $J2RE_home
It should return the path to jre.
I added the line "export J2RE=/usr/java/jre1.6.0_02" to the bottom of "profile", after that, i ran the command " source /etc/profile ".
Then I ran the command "echo $J2RE_home", however, it returns nothing.
I reboot the computer. And I checked the installation from Sun's website again, unfortunately, it still says I am using the old version ( "java-1_4_2-sun" ).
I guess sth is wrong during the installation: I forgot to mention that in YAST, there is a little marker (like a lock) beside "jre", when i put the mouse on "jre" a message shows "not available for installation", what does this mean? Do i have to uninstall java-1.4.2?
OK, one thing at a time. The reason you don't get any return from echo JRE_home is:
a/ I may have made a mistake: some distributions use "J2RE" while other ones use "JRE" - try replacing "J2RE" in /etc/profile with "JRE"; don't forget to source the file again after doing so.
b/You need to be root to see any return from that command
c/Sun's test isn't always 100% accurate; what is more reliable is opening up firefox and typing about: plugins in the address bar - it will show all plug-ins that are in use, including jre. Never mind the smiley - I didn't mean to use one, I guess it appears because I combined a colon with a p, which is equivalent to one of those happy smiley characters...duh!
d/Yast can be a pain; as you spend more time with Suse, you'll find more than once that it does some really freaky stuff.
Last edited by Tinkster; 07-24-2007 at 01:27 PM.
Reason: language cleanup ... post had been reported.
Unfortunately, after i tried all the suggestions, i still got the same bad result as before. what i am wondering is why it shows as "jre" in YAST instead of "JAVA-1.6"?
thank you for your time. just forget about this issue.
Because java can be two things: either jdk or jre. Jre is the part that serves to run applications and it is what most people need; jdk is for programmers and it can be used to write programs that will run on a jre. The jre is actually part of the jdk but since most people don't need all that programming stuff, Sun offers the jre as a separate package.
Have you tried installing jre1.5 or jre1.6 from yast yet? They are nearly identical - in fact, jre1.5 may have wider support because it is older.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.