Find the answer to your Linux question:
Results 1 to 7 of 7
I installed the latest rpm from sun Code: lrwxrwxrwx. 1 root root 16 Mar 13 11:58 default -> /usr/java/latest drwxr-xr-x. 9 root root 4096 Mar 13 11:58 jdk1.6.0_24 drwxr-xr-x 9 ...
  1. #1
    Just Joined!
    Join Date
    Nov 2010
    Posts
    4

    Keeps referencing wrong version of java

    I installed the latest rpm from sun
    Code:
    lrwxrwxrwx.  1 root root   16 Mar 13 11:58 default -> /usr/java/latest                                                                                                                                                         
    drwxr-xr-x.  9 root root 4096 Mar 13 11:58 jdk1.6.0_24                                                                                                                                                                         
    drwxr-xr-x   9 root root 4096 May 15 08:44 jdk1.6.0_25                                                                                                                                                                         
    lrwxrwxrwx   1 root root   21 May 15 08:44 latest -> /usr/java/jdk1.6.0_25
    I have my .bashrc JAVA_HOME pointing to /usr/java/latest

    But when I do a java -version I get:
    Code:
    java version "1.5.0"
    gij (GNU libgcj) version 4.5.1 20100924 (Red Hat 4.5.1-4)
    The other odd thing is that in package manager, openjdk 5 does not exist, and openjdk 6 is not installed. So I am baffled as to how it is using this version of java. Any ideas??

  2. #2
    Just Joined!
    Join Date
    Nov 2010
    Posts
    4
    looks like 1.5.0 was installed by default and is being managed by alternatives. So even though I had simlinks pointing to my jdk it was still using alternatives to manage the active java version. I installed my jdk to alternatives and made it active and it worked. Wish they would just automate this.

  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,974
    So, when you execute the command "ls -l /usr/bin/java" where is the link pointing to? My guess is that as buzzterrier says, it will be pointing to /etc/alternatives/java instead of /usr/java/default/bin/java.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  4. #4
    Just Joined!
    Join Date
    Nov 2010
    Posts
    4
    correct, it is pointing /etc/alternatives/java

    Slowly getting the hang of this linux thing!

  5. #5
    Just Joined!
    Join Date
    Feb 2011
    Posts
    83

    RE: Java

    Hi,
    You may try to uninstall the java machine, clean up all java things from the computer (the components of the integrated software environment I mean) and reinstall it back again.
    I personally would prefer to work with the java package that is listed in the repository list of the linux distro (1.6 as far as I can see), rather than downloading from the net packages with unknown risk.
    Actually the error may be insignificant and if you try to connect to the java guys from sun they may be able to fix it 'as it is at the moment'.
    The good news is that you have options and the bad news is that you have to decide to choose one (at your own discretion).
    Regards

  6. #6
    Just Joined!
    Join Date
    May 2011
    Posts
    3
    Quote Originally Posted by buzzterrier View Post
    I installed the latest rpm from sun
    Code:
    lrwxrwxrwx.  1 root root   16 Mar 13 11:58 default -> /usr/java/latest                                                                                                                                                         
    drwxr-xr-x.  9 root root 4096 Mar 13 11:58 jdk1.6.0_24                                                                                                                                                                         
    drwxr-xr-x   9 root root 4096 May 15 08:44 jdk1.6.0_25                                                                                                                                                                         
    lrwxrwxrwx   1 root root   21 May 15 08:44 latest -> /usr/java/jdk1.6.0_25
    I have my .bashrc JAVA_HOME pointing to /usr/java/latest

    But when I do a java -version I get:
    Code:
    java version "1.5.0"
    gij (GNU libgcj) version 4.5.1 20100924 (Red Hat 4.5.1-4)
    The other odd thing is that in package manager, openjdk 5 does not exist, and openjdk 6 is not installed. So I am baffled as to how it is using this version of java. Any ideas??
    Try putting the path to java 1.6 in the front of the path statement.

    PATH=/usr/java/jdk1.6.0_25/bin:$PATH
    export PATH

  7. #7
    Just Joined!
    Join Date
    Feb 2011
    Posts
    83
    Hi,

    Check up what you have on your computer.
    $ rpm -qa|grep java
    $ rpm -qa|grep jdk

    These commands list the compiled packages of java and jdk respectively.

    Then check up which of the packages are installed and connected to the system:

    $ rpm -q java
    $ rpm -q jdk

    If it lists one and the same package as 1.5 and 1.6, erase the 1.5 version:
    $ rpm -e java-1.5

    If it lists 1.6 but it is not installed, erase 1.5 (if any) and install the 1.6.

    If this gives a message 'Package java-*/jdk-* is not installed' - install the 1.6 if available, and if not - the 1.5 one.

    Maybe the system is not able to install the 1.6 for you have compatibility layers to CJI on 1.5.

    You may also try to Navigate to Add/Remove Software from the Desktop menu and in the search box to write: java
    ... and after that: jdk

    to see which of the packages are installed and which are not, which is 1.5 and which 1.6.
    In my repo some of the java packages are 1.5 and some are 1.6.

    If you come to a 'Dead End Street' ask the guys from Sun or the developers of your linux distro how to proceed.


    Regards

Posting Permissions

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