Find the answer to your Linux question:
Results 1 to 3 of 3
I installed JDK6 using an .rpm file from Sun's website. I need to have versions 1.6 of both java and javac to install another program for my work. However, I ...
  1. #1
    Just Joined!
    Join Date
    Jul 2009
    Posts
    1

    Question Upgrading to JDK6 with .rpm file in RHEL5

    I installed JDK6 using an .rpm file from Sun's website. I need to have versions 1.6 of both java and javac to install another program for my work. However, I can't seem to overwrite the old version of java that I had before installing the .rpm file. I tired to upgrade by typing

    Code:
    sudo rpm -Uvh jdk-6u14-linux-i586.rpm
    But every time I type "java -version", it still says I have the old version (1.4.2).

    Does anyone know how I can fix this? I'm srsly a n00b at this stuff so I have no idea what I'm doing. Thanks!

  2. #2
    Linux User vickey_20's Avatar
    Join Date
    Mar 2009
    Location
    Mumbai, India
    Posts
    493
    use F option to freshen the verison
    i.e rpm -Fvh jdk-6u14-linux-i586.rpm
    Only if I could understand the man pages
    Registered Linux user #492640
    OS: RHEL4,5 ,RH 9,Ubuntu

  3. #3
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,970
    The Java packaging is designed so that you can have more that one version installed on your system at any time. The programs java, javac, et al in /usr/bin are actually links (or should be links) to /usr/java/default/bin/... /usr/java/default is a link to one of the actual java versions in /usr/java, such as /usr/java/jdk1.6.0_07. You can fix this by going to /usr/java and changing the link "default" to the version you want as the default. Then /usr/bin/java, /usr/bin/javac, etc will now find the correct version. Alternatively, you can prepend /usr/java/version/bin to your PATH environment variable so it finds the program there first, which is suitable for systems where you have applications that are dependent upon the previous version.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...