Results 1 to 5 of 5
  1. #1
    deepakts is offline Member
    Join Date
    May 2010
    Posts
    3
    Rep Power
    0

    Default java -version pointing to older version

    hi all ,
    i have set the JAVA_HOME to jdk1.6.5 but still "java -version" command is pointing to older version "1.4.2". can anybody help me

  2. #2
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    Replace the older version from the PATH with the new version.

  3. #3
    deepakts is offline Member
    Join Date
    May 2010
    Posts
    3
    Rep Power
    0

    Default

    hi r035198x,
    i tried your suggesation by setting PATH to:
    PATH .:/bin:/usr/bin:/sbin:/usr/sbin:/usr/bin/X11:/usr/local/bin:/usr/local/etc:/etc:/usr/etc:.:/databases/ORACLE9I/bin:/databases/SYBASE125_ASE/OCS-12_5/bin:/databases/DB2V81_64/bin:/data/ODBC5.1_64/bin:/home/dshankar/jdk1.6.0_05/bin

    but still when i type "java -version" it shows :
    java version "1.4.2"
    gij (GNU libgcj) version 4.1.2 20080704 (Red Hat 4.1.2-44)

  4. #4
    j2me64's Avatar
    j2me64 is offline Senior Member
    Join Date
    Sep 2009
    Location
    Zurich, Switzerland
    Posts
    962
    Rep Power
    5

    Default

    Quote Originally Posted by deepakts View Post
    hi r035198x,
    i tried your suggesation by setting PATH to:
    PATH .:/bin:/usr/bin:/sbin:/usr/sbin:/usr/bin/X11:/usr/local/bin:/usr/local/etc:/etc:/usr/etc:.:/databases/ORACLE9I/bin:/databases/SYBASE125_ASE/OCS-12_5/bin:/databases/DB2V81_64/bin:/data/ODBC5.1_64/bin:/home/dshankar/jdk1.6.0_05/bin

    but still when i type "java -version" it shows :
    java version "1.4.2"
    gij (GNU libgcj) version 4.1.2 20080704 (Red Hat 4.1.2-44)

    changing the path will not help, because when you type java your os will search the command in /usr/bin and there is probably a java command that is linked to the file of gij. usually with linux the java version is set with "sudo update-alternatives --config java". you can find a small indroduction here, but you can google yourself for java for ex. linux java alternatives. good luck.

  5. #5
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    Quote Originally Posted by j2me64 View Post
    changing the path will not help, because when you type java your os will search the command in /usr/bin and there is probably a java command that is linked to the file of gij. ..
    Not always. The path can be changed so command search paths are altered to a user's taste. Typically you want the search to start with the user's profile settings. Details differ on different distros.

Similar Threads

  1. How to find java version
    By roshithmca in forum New To Java
    Replies: 3
    Last Post: 04-27-2012, 06:10 AM
  2. java API (SE) version confusion
    By Arnold in forum New To Java
    Replies: 3
    Last Post: 04-30-2010, 10:42 AM
  3. java dumps(1.6 version)
    By manieie05 in forum New To Java
    Replies: 0
    Last Post: 04-17-2009, 10:58 AM
  4. How to upgrade Java version in an application
    By New_ToJava in forum New To Java
    Replies: 37
    Last Post: 11-11-2008, 02:22 PM
  5. version of java????
    By j2vdk in forum New To Java
    Replies: 6
    Last Post: 09-07-2008, 04:34 PM

Posting Permissions

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