[ previous ] [ Contents ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ 10 ] [ 11 ] [ 12 ] [ 13 ] [ A ] [ next ]


Debian GNU/Linux Java FAQ.
Chapter 13 - Other Java alternatives for Debian


If the Java packages provided in Debian are not sufficient for your needs you might need to take a look at other alternatives. Please understand that these alternatives are not supported by the Debian project directly, you might get help, however, from the debian-java mailing list if you encounter issues with them.

Some of the alternatives presented use Debian packages which is convenient, since the user/administrator does not need to care on installation issues. However, mixing packages that come from a source which is not the Debian project might cause conflicts with your installation some times. Of course, Debian tries to integrate as many free software efforts as possible, so some of the alternatives described below might (if license permits) be included in Debian in the near future.


13.1 How can I get Debian packages from Blackdown?

If the releases provided aren't recent enough for you, you can of course install the files from the Blackdown mirrors. You can either use the Debian packages provided by Blackdown or download their tar files.

(contributed by Federico Mennite) If you want to use their packages, add the following line [3] to your /etc/apt/sources.list:

     deb proto://url/debian potato main non-free
     deb proto://url/debian woody main non-free
     deb proto://url/debian testing main non-free
     deb proto://url/debian unstable main non-free

Where proto://url is one of the mirrors from the list available at http://www.blackdown.org/java-linux/java-linux-d2.html. [4] For example, in Debian 3.0 using the main site (in the US) you would use:

     deb ftp://ftp.tux.org/pub/java/debian unstable non-free

And then do:

     $ apt-get update
     $ apt-get install j2sdk1.4

The packages will download all the library files into /usr/lib/j2se/, you just need to configure your system to use that jvm. If you use these Debian packages you will not need, for example, to configure your web browser: the symbolic links described in Can I use Java in Netscape 6.x/7.x?, Section 10.3 for libjavaplugin_oji.so will be created, as well as the alternative location of /usr/bin/java pointing to the j2se's Java.

Note that, at the moment of this writting, there are only Blackdown packages for unstable and testing of Java 1.4.

(contributed by Paul Reavis) If you download and install the JDK tar.gz files, unpack them into /usr/local/jdk1.1.x, and use symlinks to create a /usr/local/jdk and link in binaries to /usr/local/bin or whatever. It is not at all difficult to install these. However, you can get segfaults under some conditions depending on your libraries.

Here is a list of releases that are known to work under each Debian release, and what other software needed, if any, to make it happen.


13.1.1 Making swing work in Debian

(from Paul Reavis) [A quickie on getting Swing working under Debian or any Linux really]

Yes, it does work with the linux JDK; Swing is 100% Pure Java (tm)(c)(SFD) and therefore should run under any compliant JVM. Paul Reavis reported converting a commercial app (350+ classes) over to a fully-Swing GUI; I've had no problems so far.

If you are using jdk 1.1.3 or below, all you need are the class files. So, the easiest thing to do is grab the solaris distribution, in tar.Z format, from javasoft. Depending on phase of moon, they either call it swing or JFC 1.1 (to distinguish from 1.2, which is part of Java 1.2). The current version is Swing 1.0.2 (not to be confused with Java 1.0.2!). If you are using jdk 1.2.2 do not download Swing (it is already integrated in the jdk).

I don't have the archive handy here, so we'll pretend it's named swing.tar.Z. It is recommended you install it in /usr/local. So

             skronk# cd /usr/local
             skronk# tar xzf /tmp/swing.tar.Z

Now you should have a /usr/local/swing directory. To test, make sure your JAVA_HOME variable is set, and CLASSPATH is unset, and run the "runnit" script in each example. To be painfully obvious, do this:

             skronk$ cd /usr/local/swing/examples/SwingSet
             skronk$ echo $JAVA_HOME
             /usr/local/jdk
             skronk$ unset CLASSPATH
             skronk$ echo $CLASSPATH
     
             skronk$ ./runnit

Of course, your directories, shell prompt, and mileage will vary. To use with your own applications, just add the jars you want to your classpath.


13.1.2 Making Java 2 work in Debian

If you wish to use Sun's or Blackdown's jdk 1.2 or later in Debian download the packages provided by Blackdown (they are available in aptable directories) from the different mirrors available in http://www.blackdown.org/java-linux/mirrors.html (check the debian subdir). Currently there are i386 packages for the Java2 SDK and RE, JAI, Java3D and JMF. This is the recommended mechanism for more information read How can I get Debian packages from Blackdown?, Section 13.1.

Or you can download the archives yourself (that is, the tar.gz, no the .deb package) and use the following mechanism:

You should have now a fully working jdk 1.X environment, virtual machine and compiler included.

You might need to change your /etc/profile adding the proper definitions of some environment variables (CLASSPATH, JAVA_COMPILER and JAVA_HOME) so that Java programs can find the kit you just have installed. The following example show which settings you could add if you had installed Sun's 1.2.2 jdk:

     # JDK 1.2.2 (.tar)
     export CLASSPATH=.:/usr/local/sun/jdk1.2.2/lib:/usr/local/sun/jdk1.2.2/jre/lib
     export JAVA_COMPILER=javacomp
     export JAVA_HOME=/usr/local/sun/jdk1.2.2
     export PATH=$PATH:/usr/local/sun/jdk1.2.2/bin

Note: As Juergen Kreileder correctly pointed me out The preferred name for versions >= 1.2 is Java 2 SE (Standard Edition). The jdk1.3 now is called "Java2 SDK v1.3" or "J2SDK 1.3". The jre1.3 now is called "Java2 RE v1.3" or "J2RE 1.3".


13.2 How can I integrate Sun's J2SE SDK with Debian 3.1?

Warren Dodge explains how this can be done for Debian testing: the first step is to download the J2SE SDK components from http://java.sun.com/j2se/downloads.html into, e.g. /var/install/java/1.4.2. Make sure that you have write permission to the directory, and make the installer executable. Running the installer ./j2sdk-1_4_2_02-linux-i586.bin will create a directory j2sdk1_4_2_02 which can be moved to /usr/local/lib. Next, create a link ln -s /usr/local/lib/j2sdk1_4_2_02 /usr/local/lib/jdk which allows you to use the latter location to refer to the Java environment and makes upgrading a lot easier in the future.

Because Debian does not have an installer packages for Sun's J2SE, a dummy package needs to be made to let Debian know that a J2SE is installed. This is done as follows. Use the 'dummy' package control files provided by java-common to satisfy dependencies:

     mkdir -p /var/install/java/pkg
     cd /var/install/java/pkg
     cp /usr/share/doc/java-common/dummy-packages/*.control .
     equivs-build java-compiler-dummy.control
     equivs-build java-virtual-machine-dummy.control
     equivs-build java1-runtime-dummy.control
     equivs-build java2-compiler-dummy.control
     equivs-build java2-runtime-dummy.control

You should now have five packages in /var/install/java/pkg which should be installed.

The command update-alternatives is used in Debian to choose which of several pacakges to use when several can do the same thing. ("Java" can also be provided by kaffe, Blackdown (see above), etc). See "man update-alternatives" for more details. Use this command to install the programs you need with commands like:

     update-alternatives --verbose --install /usr/bin/java java /usr/local/lib/jdk/bin/java 500 \
       --slave /usr/share/man/man1/java.1 java.1 /usr/local/lib/jdk/man/man1/java.1

Run java once as root to allow system preference directories to be created and to check if Sun's java is working properly:

       java -version

13.3 How can I integrate Sun's J2SE SDK with Debian 3.0?

The procedure is similar to the one described for Debian 3.1 . However, the java-common in stable does not have the *.control files. Therefore, you need to install the java-common package from testing or unstable. Versions 0.19 and 0.20 can be safely be installed and require the installation of the equivs package, but the one from stable is just fine.

Notice, however, that newer J2SE versions (notably 1.4.2_04 instead of 1.4.1_02) might depend on newer libc6 or libgcc1 libraries. If you cannot backport (recompile) this package to your libraries you will need are limited to using jdk 1.3.1-11 (which requires libstdc++2.9-glibc2.1 from the oldlibs section).


13.4 Java programs not yet available on Debian

The following are programs that have not yet been packaged for Debian nor is there an installer. There are quite a lot Java programs out there and this list is not an exhaustive list, it only includes programs that might be packaged for Debian or those that someone is working on an installer for:


[ previous ] [ Contents ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ 10 ] [ 11 ] [ 12 ] [ 13 ] [ A ] [ next ]


Debian GNU/Linux Java FAQ.

$Revision: 1.57 $ 29 Dezember 2009Sunday, 4th November

Javier Fernández-Sanguino Peña jfs@debian.org