Results 1 to 2 of 2

Thread: Why the Java Runaround?

  1. #1
    Join Date
    Mar 2007
    Location
    England & India
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Why the Java Runaround?

    I'm trying to seize the bull by the horns by understanding something about this Java Devil; I think I should remove the one here is Oneiric and update it.
    But first I am opening Terminal and typing "which java" which returns:

    /usr/bin/java
    and when I go and look at that file, it's a link to:
    /etc/alternatives/java
    and when I go there I see THAT is a link to:

    /usr/lib/jvm/java-6-openjdk/jre/man/man1/java.1.gz
    So I'd like to understand a bit about why there is this runaround, if I am to try to understand Java even a little bit. Which I don't now.

    Regards, John
    Last edited by Andavane; April 3rd, 2012 at 06:23 AM. Reason: typo
    a) Sony Vaio VGN-S3HP (12.04 Precise)
    b) Lenovo Thinkpad X201i (12.04 Precise) Dual-boot ī Windows 7

  2. #2
    Join Date
    Nov 2010
    Location
    Madras, India
    Beans
    194
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Why the Java Runaround?

    Quote Originally Posted by Andavane View Post
    I'm trying to seize the bull by the horns by understanding something about this Java Devil; I think I should remove the one here is Oneiric and update it.
    But first I am opening Terminal and typing "which java" which returns:



    and when Ii go and look at that file, it's a link to:


    and when I go there I see THAT is a link to:



    So I'd like to understand a bit about why there is this runaround, if I am to try to understand Java even a little bit. Which I don't now.

    Regards, John
    The "Alternatives" system is something Debian first introduced to deal with several packages providing the same command. The default command is simply a link to the alternatives directory, which then redirects it to the appropriate binary. It's used by several 'generic' commands as well, like 'x-www-browser', 'editor' and so on.

    In Java's case, this allows you to have multiple versions of the JVM installed, and use alternatives to set the default. You can use 'update-alternatives' to set the defaults for all commands registered with alternatives. See man update-alternatives.

    As an aside, the command output you've indicated above seems abnormal. I'd expect /etc/alternatives/java to redirect to the java binary, not the man page for it.

Tags for this Thread

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
  •