3

I have a Centos 6.2 machine. It currently has JDK 1.6.0_26 installed. I would like to update that to 1.6.0_38, the current release version.

I saw a comment somewhere about sudo apt-get; apt-get does not seem to be a command that this box knows. So I skipped that one.

I saw some RPM stuff on the box, and RPM was a recognized command, so I downloaded the JDK RPM.bin file from Oracle, transferred it to the Linux machine, chmod'd it, and ran the bin file - this is apparently supposed to extract and install the RPM. It hits an error doing this (complaining about ./install.sfx.5513: /lib/ld-linux.so.2: bad ELF interpreter as well as some issues about JavaDB which I don't know that that's important) and nothing appears to have changed. I tried to extract the RPM file (using the -x switch) and still nothing appears to have changed - if it extracted it I have no idea where it went, or what I would type in a relevant rpm command to get it to do something. Searching on that error led me to some suggestion that I needed to install glibc - but also started talking about Yum.

I also have Yum - this looks like it might be an even more helpful tool. I can yum list jdk and it shows me that there is a package installed from yum ("jdk.x86_64") but yum update does nothing. I tried yum install jdk on a whim and it said "package jdk-1.6.0_26-fcs.x86_64 already installed and latest version" which is strange, since 26 is not the latest version.

Any suggestions on what I should try next?

1

4 Answers 4

4

Strange. Executing the (*rpm.bin) should work. Did you download the 64 or 32-bit variant - suiting your OS?

Apart from that Oracle Java 6 is EoL in February. So you should be switching to Java 7 now.

For you other question - with regards to the existing repositories - your jdk6u26 is the most current available. This does not check any Oracle-resources in the internet.

Sadly Oracle does not provide a repository (Adobe does now). Only a repository can link updates "online" to external resources (e.g. http/Internet).

2
  • I thought I'd grabbed the appropriate 64 bit one, maybe I am mistaken. There's a corporate level rule against Java 7 still (security) so it has to be 6. Thanks for clearing up the repository confusion.
    – Mikeb
    Jan 11, 2013 at 21:37
  • @Mikeb that rule against Java 7 ist pretty sane - according to its current unsolved security problems with 7u11.
    – Nils
    Jan 27, 2013 at 20:20
1

I found a different post / comment related to the ELF error that helped.

yum install /lib/ld-linux.so.2

This installed glibc stuff (apparently this was a 32 bit vs 64 bit problem?).

Then I was able to run the non-RPM version (maybe the RPM one would have worked, but I had downloaded the non RPM one too in case there was an issue there) in my /usr/java folder and it appears to have installed the JDK.

I don't know if I've done something wrong in that mess, but, hey, inching towards success.

1

This site shows how to install several different packages on RHEL/CentOS/Fedora:

http://www.if-not-true-then-false.com/

In particular, for Java:

http://www.if-not-true-then-false.com/2010/install-sun-oracle-java-jdk-jre-7-on-fedora-centos-red-hat-rhel/

2
  • Please provide the relevant text for the answer here, and provide links only as backup information. As (not if or when) those links become invalid at some time in the future, your answer, as is, will have no value left at all.
    – Anthon
    Nov 5, 2013 at 15:19
  • 1
    I understand why you're insisting that I type out the instructions found on the external site. But the installation instructions get updated from time to time.. so copying them here verbatim will only provide a snapshot of something that works at this moment.
    – cjpembo
    Nov 22, 2013 at 20:33
1

Any newb friendly suggestions on what I should try next?

If you are willing to go to JDK 7, there's a Oracle .tar.gz, which makes it very easy to install. Unfortunately there is not one for JDK 6 (But: if there is a plain rpm around, you could easily extract its contents much the same way; an rpm wrapped as a bin is more difficult).

http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html

In this case, you are unpacking into one directory, meaning the executables are out of $PATH. You can either add the paths to $PATH or softlink java, and javac (and if you want jar, javadoc, etc.) into an appropriate /bin/. The later case will work but creates some hassles, especially if you cannot first remove your current java.

However, if you add to $PATH at the front:

export PATH=/usr/local/jdk7/bin/:$PATH

Then /usr/local/jdk7/bin will be checked before /usr/bin or wherever your existing java is -- no hassles.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .