4.1 What full-fledged Java development platforms are available in Debian?
If you are looking for an integrated, java virtual machine, compiler and
runtime environment Debian does provide them. Of course that would depend on
the Debian GNU/Linux version you are using, generally speaking they would be:
The deprecated Kaffe in Debian 5.0 Lenny.
The deprecated Sun Java 5 jdk, available in the Debian 5.0 Lenny
release in the non-free component.
Sun's Java 6 jdk, available in Debian Lenny and Debian
Squeeze, also as packages in the non-free component.
Sun's OpenJDK 6, available since the Debian 5.0 Lenny release in the
main section.
The combination GCJ, GIJ, and Classpath in the main section.
It is recommended to install one of the default-jdk or default-jre meta
packages which either installs OpenJDK or GCJ depending on the architecture and
Debian version.
4.2 What free platforms are there and how can I contribute?
Please help one of the Free Java implementations if you want to use Java in
Debian. There are a lot of projects that you can choose from:
Classpath http://www.classpath.org. Most of
the Standard classes for Java 1.2 (except Swing and RMI) are implemented by the
ClassPath project, it tries to build an alternative to jdk's 1.2 core classes.
(NB: This was removed from Squeeze)
There are binary packages available for the Java 5 and Java 6 platforms since
the Debian 5.0 ('lenny') release. These packages are available in the
non-free section, so you have to configure your apt sources
appropriately. If you have the following in your
/etc/apt/sources.list:
deb http://ftp.debian.org/debian lenny main
you need to change it to:
deb http://ftp.debian.org/debian lenny main contrib non-free
Once this is done and you have updated your package database. You can either
install the Java development kit:
apt-get install sun-java6-jdk
or the Java runtime environment:
apt-get install sun-java6-jre
Similarly, you can install the Java 5 development kit:
apt-get install sun-java5-jdk
or the Java 5 runtime environment:
apt-get install sun-java5-jre
You might want to update the alternatives system to have Sun's tools as the
default:
update-java-alternatives -s java-6-sun
Or for java 5:
update-java-alternatives -s java-1.5.0-sun
4.3.2 Sun's OpenJDK
Sun adopted in november 2006 the GPL license for almost all of the virtual
machine and GPL v2 + the Classpath exception[1]for the class libraries and those
parts of the virtual machine that expose public APIs.
As a consequence, the free OpenJDK code is available in Debian since the 5.0
(lenny) release.
Yes, but only if it can be build and run with Java programs/tools in
main, and if it has a Debian compliant open source license. If it needs
programs from contrib or non-free, then is must go into contrib or
non-free, depending on the license of the program itself.
4.4.2 Is there a good example Debian package?
There are many Debian packages of both Java applications and libraries. These
may serve as an good starting point, as it can serve as an example for making a
new Debian package.
4.4.3 What tools are available to make maintaining a Java packages easier?
Both cdbs and debhelper (dh7) have support for ant scripts. There are also a
number of specialized tools or build helpers. Have a look at
javahelper or maven-debian-helper.
gcj-jdk also has a dh_javadoc tool.
4.4.4 Linking package Javadoc to system javadoc.
The java-policy mandates that documentation must be linked with with the
javadoc installed on the system. This can be done by passing javadoc the
"-link" argument or by using the <link> tag in ant. An
example:
# command line example of linking against system doc.
javadoc -link /usr/share/doc/default-jdk-doc/api [other arguments]
<!-- Ant example of linking against system doc -->
<javadoc [attributes]>
<link href="/usr/share/doc/default-jdk-doc/api/" />
[other tags]
</javadoc>
The documentation must be installed at the time the linking is done; so in the
example cases above the package would need a Build-Depends or a
Build-Depends-Indep on default-jdk-doc.
Here is a short list of packages that can be used for reference: