UBUNTU JAVA problem.

UBUNTU JAVA problem.

Tzafrir Cohen tzafrir at cohens.org.il
Tue Oct 13 14:04:21 IST 2009


On Tue, Oct 13, 2009 at 01:35:44PM +0200, geoffrey mendelson wrote:
>
> On Oct 13, 2009, at 11:56 AM, Hetz Ben Hamo wrote:
>
>> Sorry, but I don't get it: Why do they use the Gnu Java instead of the 
>> openJDK? Fedora installs OpenJDK by default..
>
>
>
> I did not "get it" either. One minute I'm happily running Sun's JRE at  
> the 1.6 level and the next, a link was changed and I wasn't. I saved the 
> old link.
>
> Running  the old link (as in after their change last night): /etc/ 
> alternatives/java.old -version
> java version "1.5.0"
> gij (GNU libgcj) version 4.3.3
>
> Copyright (C) 2007 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is 
> NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR  
> PURPOSE.
>
>
> Running the link I fixed: /etc/alternatives/java -version
> java version "1.6.0_16"
> Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
> Java HotSpot(TM) Client VM (build 14.2-b01, mixed mode, sharing)

Short answer:

  aptitude install openjdk-6-jre

Long answer:

Here's what I have here (Debian Lenny)

$ /usr/sbin/update-alternatives --display java
java - status is auto.
 link currently points to /usr/lib/jvm/java-6-openjdk/jre/bin/java
/usr/lib/jvm/java-gcj/jre/bin/java - priority 1042
/usr/bin/gij-4.3 - priority 43
/usr/lib/jvm/java-6-openjdk/jre/bin/java - priority 1061
 slave java.1.gz: /usr/lib/jvm/java-6-openjdk/jre/man/man1/java.1.gz
Current `best' version is /usr/lib/jvm/java-6-openjdk/jre/bin/java.

As you can see, I happen to have gij installed. It has a priority of 43.
However I also have openjdk's jre installed, with a somewhat higher
priority (1061).

There are also non-free package with sun's JDK and JRE. I suspect they
have somewhat higher priority (if you bothered installing them you
probably want them).

OpenJDK and Sun's JDK are not the only ones around. Some might never
have existed if Java would have been free to start with (I guess gij may
be one), but others perform better in some important use cases (e.g.
embedded systems).

tzafrir at sweetmorn:~$ aptitude search '~Pjava-virtual-machine'
p   gij                             - The GNU Java bytecode interpreter
p   gij-4.2                         - The GNU Java bytecode interpreter
i A gij-4.3                         - The GNU Java bytecode interpreter
p   jamvm                           - virtual machine which conforms to JVM spec
i A java-gcj-compat                 - Java runtime environment using GIJ
i A java-gcj-compat-headless        - Java runtime environment using GIJ (headle
p   kaffe-jthreads                  - A green threads enabled version of the Kaf
p   kaffe-pthreads                  - A POSIX threads enabled version of the Kaf
i A openjdk-6-jre-headless          - OpenJDK Java runtime, using Hotspot JIT (h

If a program works well with jamvm, which only takes 628kb of disk
spaces once installed, why bother with the whole big bad OpenJDK?
(66,784 kb, not including dependencies. I ommited the Classpath
dependency for both).

-- 
Tzafrir Cohen         | tzafrir at jabber.org | VIM is
http://tzafrir.org.il |                    | a Mutt's
tzafrir at cohens.org.il |                    |  best
ICQ# 16849754         |                    | friend



More information about the Linux-il mailing list