Differences between revisions 1 and 2
Revision 1 as of 2010-05-04 06:45:57
Size: 1380
Comment: initial version
Revision 2 as of 2010-05-04 06:46:44
Size: 1456
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
This page documents an idea how to improve the java alternatives system.

This page documents an idea how to improve the java alternatives system.

Problem

All java related tools such as java, javac, javadoc are symlinks that are handled by the alternatives system. Neither the nonprivileged user nor the Debian packager can easily override which JDK/JRE should be used. There is some support for overriding in the java-wrappers package but the implementation is not very Debianish. That is why we will introduce sensible tools to the java-common package.

Use Cases

Basic Usage

sensible-java or sensible-javac will just run java and javac by default but you can change it by specifying JAVA_HOME:

JAVA_HOME=/usr/lib/jvm/default-java
export JAVA_HOME
sensible-java ...

You get more flexibility with JAVA_HOME_DIRS:

JAVA_HOME_DIRS=/usr/lib/jvm/default-java:/usr/lib/jvm/java-6-sun
export JAVA_HOME_DIRS
sensible-java ...

or even better with JAVA_FLAVOR:

JAVA_FLAVOR=sun:local
export JAVA_FLAVOR
sensible-java ...

JAVA_HOME has priority over JAVA_HOME_DIRS which has priority over JAVA_FLAVOR. Some examples for JAVA_FLAVOR are:

  • default which points to default-java
  • sun which will try openjdk-6, sun-java6, and sun-java5
  • gcj which points to gcj
  • local which is the command provided by the alternatives system

A more complete list will be documented later.


CategoryJava