LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   A question about installing JDK/Java with yum (https://www.linuxquestions.org/questions/linux-software-2/a-question-about-installing-jdk-java-with-yum-902945/)

thomas2004ch 09-14-2011 05:11 AM

A question about installing JDK/Java with yum
 
Hi,

As I list the available JDK with yum I got followings:
Code:

...
java-1.6.0-sun.i586      1:1.6.0.24-1jpp.1.el5
java-1.6.0-sun.x86_64    1:1.6.0.24-1jpp.1.el5
java-1.6.0-sun-devel.i586
java-1.6.0-sun-devel.x86_64
java-1.4.2-bea.i686      1.4.2.16-1jpp.2.el5
java-1.4.2-bea-demo.i686 1.4.2.16-1jpp.2.el5
java-1.4.2-bea-devel.i686
java-1.4.2-bea-jdbc.i686 1.4.2.16-1jpp.2.el5
java-1.4.2-bea-missioncontrol.i686
java-1.4.2-bea-src.i686  1.4.2.16-1jpp.2.el5
java-1.4.2-bea-uninstall.i686
java-1.4.2-gcj-compat.x86_64
java-1.4.2-gcj-compat-devel.i386
java-1.4.2-gcj-compat-devel.x86_64
java-1.4.2-gcj-compat-javadoc.x86_64
java-1.4.2-gcj-compat-src.x86_64
java-1.4.2-ibm.i386      1.4.2.13.9-1jpp.1.el5
java-1.4.2-ibm.x86_64    1.4.2.13.9-1jpp.1.el5
java-1.4.2-ibm-demo.i386 1.4.2.13.9-1jpp.1.el5
java-1.4.2-ibm-demo.x86_64
java-1.4.2-ibm-devel.i386
java-1.4.2-ibm-devel.x86_64
java-1.4.2-ibm-javacomm.i386
java-1.4.2-ibm-javacomm.x86_64
java-1.4.2-ibm-jdbc.i386 1.4.2.13.9-1jpp.1.el5
java-1.4.2-ibm-plugin.i386
java-1.4.2-ibm-src.i386  1.4.2.13.9-1jpp.1.el5
java-1.4.2-ibm-src.x86_64
java-1.5.0-bea.x86_64    1.5.0.14-1jpp.2.el5
java-1.5.0-bea-demo.x86_64
java-1.5.0-bea-devel.x86_64
java-1.5.0-bea-jdbc.x86_64
java-1.5.0-bea-mercuryprofiler.x86_64
java-1.5.0-bea-missioncontrol.x86_64
java-1.5.0-bea-src.x86_64
java-1.5.0-bea-uninstall.x86_64
java-1.5.0-ibm.i386      1:1.5.0.12.4-1jpp.1.el5
java-1.5.0-ibm.x86_64    1:1.5.0.12.4-1jpp.1.el5
java-1.5.0-ibm-accessibility.x86_64
java-1.5.0-ibm-alsa.i386 1:1.5.0.3-1jpp.4.el5
java-1.5.0-ibm-demo.i386 1:1.5.0.12.4-1jpp.1.el5
java-1.5.0-ibm-demo.x86_64
java-1.5.0-ibm-devel.i386
java-1.5.0-ibm-devel.x86_64
java-1.5.0-ibm-javacomm.i386
java-1.5.0-ibm-javacomm.x86_64
java-1.5.0-ibm-jdbc.i386 1:1.5.0.12.4-1jpp.1.el5
java-1.5.0-ibm-plugin.i386
java-1.5.0-ibm-src.i386  1:1.5.0.12.4-1jpp.1.el5
java-1.5.0-ibm-src.x86_64
java-1.5.0-sun.x86_64    1.5.0.22-1jpp.1.el5
java-1.5.0-sun-demo.x86_64
java-1.5.0-sun-devel.x86_64
java-1.5.0-sun-jdbc.x86_64
java-1.5.0-sun-plugin.i586
java-1.5.0-sun-src.x86_64
java-1.5.0-sun-uninstall.x86_64
java-1.6.0-bea.x86_64    1:1.6.0.03-1jpp.2.el5
java-1.6.0-bea-demo.x86_64
java-1.6.0-bea-devel.x86_64
java-1.6.0-bea-jdbc.x86_64
java-1.6.0-bea-missioncontrol.x86_64
java-1.6.0-bea-src.x86_64
java-1.6.0-bea-uninstall.x86_64
java-1.6.0-ibm.i386      1:1.6.0.9.2-1jpp.2.el5
java-1.6.0-ibm.x86_64    1:1.6.0.9.2-1jpp.2.el5
java-1.6.0-ibm-accessibility.x86_64
java-1.6.0-ibm-demo.i386 1:1.6.0.9.2-1jpp.2.el5
java-1.6.0-ibm-demo.x86_64
java-1.6.0-ibm-devel.i386
java-1.6.0-ibm-devel.x86_64
java-1.6.0-ibm-javacomm.i386
java-1.6.0-ibm-javacomm.x86_64
java-1.6.0-ibm-jdbc.i386 1:1.6.0.9.2-1jpp.2.el5
java-1.6.0-ibm-jdbc.x86_64
java-1.6.0-ibm-plugin.i386
java-1.6.0-ibm-plugin.x86_64
java-1.6.0-ibm-src.i386  1:1.6.0.9.2-1jpp.2.el5
java-1.6.0-ibm-src.x86_64
java-1.6.0-openjdk.x86_64
java-1.6.0-openjdk-demo.x86_64
java-1.6.0-openjdk-devel.x86_64
java-1.6.0-openjdk-javadoc.x86_64
java-1.6.0-openjdk-src.x86_64
java-1.6.0-sun.i586      1:1.6.0.26-1jpp.1.el5
java-1.6.0-sun.x86_64    1:1.6.0.26-1jpp.1.el5
java-1.6.0-sun-demo.i586 1:1.6.0.26-1jpp.1.el5
java-1.6.0-sun-demo.x86_64
java-1.6.0-sun-devel.i586
java-1.6.0-sun-devel.x86_64
java-1.6.0-sun-jdbc.i586 1:1.6.0.26-1jpp.1.el5
java-1.6.0-sun-jdbc.x86_64
java-1.6.0-sun-plugin.i586
java-1.6.0-sun-plugin.x86_64
java-1.6.0-sun-src.i586  1:1.6.0.26-1jpp.1.el5
java-1.6.0-sun-src.x86_64
...

My questions:
1.
Can I install all these?

If yes, how can I find out where are these (under which dir) installed?

2.
How can I set the JAVA_HOME?

3.
I can also install the Java manually such like download the zip und unpack it. What's the ad and disadvantage using yum or not?



Thomas

ButterflyMelissa 09-14-2011 05:15 AM

Hi,

You'll only need the most recent one...so

Quote:

yum install java-1.6.0-sun.i586
...ought to do it.

Quote:

How can I set the JAVA_HOME?
in the console type:

Quote:

JAVA_HOME=/the/folder
And in the corresponcing rc, enter that line to persist it tru the next startup...

Luck

Thor

thomas2004ch 09-14-2011 06:12 AM

Quote:

Originally Posted by Thor_2.0 (Post 4471328)
Hi,

You'll only need the most recent one...so

If I want several version of Java?


Quote:

in the console type:

And in the corresponcing rc, enter that line to persist it tru the next startup...
Yes. But before I set the JAVA_HOME, I have to know where the Java installed, right?

knudfl 09-14-2011 07:11 AM

No problem having 2 .. 4 versions. And don't set any "JAVA_HOME".

Use the "Redhat method" : The alternatives "version switcher".

1) su
2) /sbin/alternatives/ --config java


And if a new version has not been automatically added to /etc/alternatives,
a command like this will do :
/usr/sbin/alternatives --install /usr/bin/java java /usr/java/jre1.6.0/bin/java 20000
or /usr/sbin/alternatives --install /usr/bin/java java /usr/java/jdk1.6.0_26/bin/java 2
http://www.if-not-true-then-false.co...-red-hat-rhel/

The location etc. can be found with : ls /usr/java

.

thomas2004ch 09-14-2011 07:51 AM

Hi,

In our case we use different JDK versions at the same time by different user. That menas the version switcher is not suitable in this case.

wpeckham 09-14-2011 11:41 AM

Different versions for different users
 
IN that case: you might -- set the JAVA_HOME on the users profile, .bash_profile, or .bashrc (or as appropriate depending upon their shell) and add ${JAVA_HOME}/bin to the PATH for that user (in the same file).


All times are GMT -5. The time now is 10:57 PM.