LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   install/uninstall in linux (https://www.linuxquestions.org/questions/linux-newbie-8/install-uninstall-in-linux-571704/)

littlewenwen 07-23-2007 03:36 PM

install/uninstall in linux
 
Dear All,

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!

jay73 07-23-2007 03:45 PM

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.

littlewenwen 07-23-2007 05:38 PM

Thank you very much for your reply.

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?

jay73 07-23-2007 06:04 PM

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.

littlewenwen 07-23-2007 07:20 PM

Thank you.

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?

jay73 07-23-2007 07:23 PM

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.

littlewenwen 07-23-2007 10:02 PM

Thank you.

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" ).

What I did wrong?

littlewenwen 07-23-2007 10:32 PM

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?

jay73 07-24-2007 12:03 AM

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.

littlewenwen 07-24-2007 12:36 AM

thank you.

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.

jay73 07-24-2007 01:43 AM

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.

littlewenwen 07-24-2007 09:59 AM

thank you. But I couldn't find jre1.5 in YAST.


All times are GMT -5. The time now is 11:07 PM.