Results 1 to 6 of 6

Thread: java version different from javac

  1. #1
    Join Date
    Aug 2007
    Beans
    190
    Distro
    Kubuntu 10.04 Lucid Lynx

    java version different from javac

    Hi,

    When I type the version of javac in the terminal i get the following:


    PHP Code:
    javac 1.6.0_03 

    However the java version is :
    PHP Code:
    java version "1.5.0"
    gij (GNU libgcjversion 4.2.1 (Ubuntu 4.2.1-5ubuntu5)

    Copyright (C2007 Free Software FoundationInc.
    This is free softwaresee the source for copying conditions.  There is NO
    warranty
    not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE
    So the complier is 1.6 yet the runtime it java5, how do i fix this?

  2. #2
    Join Date
    Jan 2007
    Beans
    Hidden!

    Re: java version different from javac

    Try this:

    Code:
    sudo update-java-alternatives
    Hopefully you get to a screen where you can select the java version you want. Haven`t tested it myself...

  3. #3
    Join Date
    Apr 2008
    Location
    Texas
    Beans
    11
    Distro
    Ubuntu

    Re: java version different from javac

    You might make sure you have java installed correctly through the Synaptic Package Manager.
    sun-java5-jdk or sun-java6-jdk

    Once you are sure you have the version of java you want to use installed, you need to match the java compiler to the correct version of java.

    This will give you the choice to choose which version of java on your computer you want to use:
    Code:
    sudo update-alternatives --config java
    This will give you a choice to choose which compiler you want to use. (i.e. version 1.5.0 or 1.6.0)
    Code:
    sudo update-alternatives --config javac
    Once they are using the same java version, you should be set to go.

  4. #4
    Join Date
    Aug 2007
    Beans
    190
    Distro
    Kubuntu 10.04 Lucid Lynx

    Re: java version different from javac

    alright this worked out fine...just one thing...how do i uninstall java 5 since i already have java 6?

    I'm actually having similar problems similar to this like having two versions of alsa...how can i remove those programs?

  5. #5
    Join Date
    Apr 2008
    Location
    Texas
    Beans
    11
    Distro
    Ubuntu

    Re: java version different from javac

    To uninstall java5, just use the Synaptic Package Manager. Search for sun-java5-jdk and it will remove itself and all the dependencies (of course after you hit apply). I'm not familiar with alsa, but I would assume you could uninstall it the same way.

  6. #6
    Join Date
    Aug 2006
    Location
    Uruguay
    Beans
    1,645

    Re: java version different from javac

    Quote Originally Posted by koba101 View Post
    alright this worked out fine...just one thing...how do i uninstall java 5 since i already have java 6?

    I'm actually having similar problems similar to this like having two versions of alsa...how can i remove those programs?
    If you have the Sun JRE,
    Code:
    sudo aptitude remove sun-java5-jre
    That however is not Java, its GNU's implementation of Java, im not sure what the package is called. Look for packages that begin with GCJ.

    Member of the UbuntuBeginnersTeam

    Member of the UnansweredPostsTeam

Bookmarks

Posting Permissions

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