I was well aware of some things adressed regarding the draft I
sent... however it was just a draft :) I was at the same time downloading
the Mailing list archive of the last 5 months.
        I have been through it and "rescued" information I found worth
adding and some of which people have suggested after reading the draft.

        Feel free to send me any comments/suggestion ... *however* I hope
that when a final 1.0 version of the FAQ is available somebody on the
debian-java mailing lists adopts the FAQ since I will probably not be able
to keep it up to date.

        Regards

        Javi

PD: All the source (sgml) is available at
http://www.dat.etsit.upm.es/~jfs/debian/doc/debian-java. Please note that I
have patched debiandoc's sgml in order to add a <quote> (like in
linuxdoc-sgml)
                             Debian Java FAQ.
                             ----------------

             Javier Fernández-Sanguino Peña <[EMAIL PROTECTED]>

                                16 feb 1999


-------------------------------------------------------------------------------


Resumen
-------

     Answers to Frequently Asked Questions on Debian and Java. Any changes
     to this FAQ are appreciated, please send them to the current
     maintainer.


Nota de Copyright
-----------------

     Copyright © 1998,1999 Javier Fernández-Sanguino Peña, The current FAQ
     has been made with tidbits of information from the debian-java mailing
     list and made available as public domain.


-------------------------------------------------------------------------------


Contenidos
----------

     1.        Introduction
     1.1.      What is java?
     1.2.      Why would I be interested in Java?
     1.3.      Where can I read more about Java?
     1.4.      Status of Java in Debian

     2.        Java development
     2.1.      What java development platforms are available in Debian?
     2.2.      What free platforms are there and how can I contribute?
     2.3.      JDK1.2
     2.4.      IBM's jdk1.1
     2.5.      JRE

     3.        Java Compilers
     3.1.      What Java compilers are available in Debian?

     4.        Java Virtual Machines (JVM)
     4.1.      What jvms work in Debian?
     4.2.      What free jvms are available in Debian?
     4.3.      Are there know problems?

     5.        Java-related programs
     5.1.      What java related programs are available in Debian?
     5.2.      What virtual packages could I use?
     5.3.      Making packages for java programs
     5.4.      Installer packages

     6.        Java servlets
     6.1.      How can I make Java servlets work?
     6.2.      Do servlets work with kaffee?
     6.3.      Do I need commercial Java in order to run servlets?

     7.        Java policy
     7.1.      Is there a Java policy for Debian?
     7.2.      Are there Holes in the Java Policy?

     8.        Running Java in Debian
     8.1.      Is there a way, using free software to run a Java program in
               Debian?


-------------------------------------------------------------------------------


1. Introduction
---------------


1.1. What is java?
------------------

     TODO


1.2. Why would I be interested in Java?
---------------------------------------

     TODO


1.3. Where can I read more about Java?
--------------------------------------

        * http://www.javasoft.com

        * http://www.blackdown.org/java-linux.html for specific information
          for Linux.



1.4. Status of Java in Debian
-----------------------------

     The first thing you should understand about the design strategy of
     Debian is that our goal is to produce a 100% Open Source platform. In
     that sense, some of these tools are not available in the standard
     Debian distribution for licensing reasons as opposed to some technical
     motivation.

     That said, basically all of the technologies you might ask about can
     be or are available for Debian immediately. In order to usefully
     answer your questions, however, here you have a status from an Open
     Source availability perspective.

     If you are _really_ interested, read the threadas following
     http://www.debian.org/Lists-Archives/debian-java-9912/msg00015.html
     and
     http://www.debian.org/Lists-Archives/debian-java-9910/msg00017.html.
     This section is a summary of the information therein.

1.4.1. Java1 compiler (.java to .class)
---------------------------------------

     There is the Kopi Java Compiler written in Java. And the super fast
     Jikes written in C++.

     Gcj can also compile .java to .class. It currently does not handle
     inner classes, but that is being actively worked on. It is written in
     C, so is reasonably fast. It generates reasonable good bytecode. And
     of course being able to use the same compiler for .java to .class and
     .java to native has its advantages.

1.4.2. Java1 JVM/JIT
--------------------

     Kaffe 1.0.5 is largely feature complete and now includes support for
     RMI. It is not clear as to whether Kaffe's serialization is "pin
     compatible" with Sun's implementation in all cases so there may be
     interoperation issues in some casses. Kaffee comes with a big class
     library.

     Japhar is also available.

     libgcj (the run-time library for gcj) now includes an interpreter and
     ClassLoader

1.4.3. Java1 native compiler
----------------------------

     GCC, the Gnu Compiler Collection comes with GCJ, the Gnu Compiler for
     Java

1.4.4. Java2 native compiler
----------------------------

     It is unclear whether native compiler refers to the adaptive JIT
     capabilities in Java2 or to a compiler that understands Java2
     semantics. In either case, Kaffe's JIT strategy is not adaptive but is
     still performant and becoming more so and it is believed IBM's Jikes
     compiler understands Java2 concepts such as weak references.

1.4.5. Java2 foundation libraries
---------------------------------

     Many of these components have been cloned under an Open Source
     license. Kaffe provides many of these routines, including an
     up-to-date RMI implementation. There are, however, definatly
     shortcomings. Swing, as far as I know, has not been cloned.

1.4.6. Debugger (jgb equivalent)
--------------------------------

     Debian has no debugger currently. Gdb can debug code produced by Gcj.
     Cygnus also wrote support for Gdb to debug other VMs using JVMDI. This
     has not been released, because the Gdb internals were changed at the
     same time, and no-one has had time to re-integrate the changes. We can
     probably get Cygnus to release the old code, if someone wants to look
     into getting this stuff working with the current Gdb internals. (A
     non-trivial job.)

1.4.7. Appletviewer tool
------------------------

     Kaffee comes with one.

1.4.8. Jar tool
---------------

     `FastJar' which is indeed very fast.

1.4.9. Javadoc tool
-------------------

     `doc++' can work with C++ and Java.

1.4.10. EJB
-----------

     There is activity in this area, the most noteworthy being the Open
     Source EJB implementation from Bull in France called Jonas. I have
     done some work with this system and it provides a good start towards a
     full EJB feature set. In particular, it provides a transaction monitor
     and a container based persistance implementation. I have used this
     system on Linux with free databases such as Postgresql. I have not
     been able to get the system fully operational on Kaffe. Additionally,
     the system depends on many Sun APIs which have not been cloned (JTA,
     JNDI, and EJB itself).

1.4.11. JAIN
------------

     It seems to be a system for controlling large scale, integrated
     communications infrastructures and modeling events with such networks
     via the JavaBeans API. The scale of this effort seems very large and
     encompasses the work of many organizations. The work is very new and
     seems to tie into Sun's SCSL strategy, which leads us me to believe
     that there is not much in the way of Open Source options in this area.
     However, some protocols such as H.323 are genuinely open and are even
     cloned so it is possible that chunks of the JAIN system may exist in a
     scattered manner. We have no knowledge of a serious Open Source
     implementation of RTP or the H.323 infrastructures in Java.

1.4.12. Jini
------------

     Jini presents an especially pronounced Open Source problem. Jini is
     only available as source from Sun and that source is only available
     under the SCSL. The SCSL is not compatible in any sense with either
     the legal mechanics or the political spirit of Free Software. The SCSL
     also makes cloning the API of an SCSL implementation illegal which
     precludes even a clean room replication of Jini. If you are interested
     in tuple space type implementations there are Open Source options.


-------------------------------------------------------------------------------


2. Java development
-------------------


2.1. What java development platforms are available in Debian?
-------------------------------------------------------------

        * Sun's jdk

        * guavac

        * kafee

        * ibm



2.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. An alternative to jdk's 1.2
          core classes.

        * kaffe: http://www.kaffe.org

        * Japhar: http://www.japhar.org

        * gcj and libgcj: http://sourceware.cygnus.com/java/

        * jikes: http://www.research.ibm.com/jikes/. A fast compiler
          written in C++ (check also
          http://www10.software.ibm.com/developerworks/opensource/jikes/).
          (The new license seems to be finally really free)

        * kopi: http://www.dms.at/kjc/.Yet Another Free Java Compiler, this
          time written in Java, and GPL. Included in Kaffe since release
          1.0.5.

        * FastJar http://fastjar.sourceforge.net/, as a jar tool.

        * Classpath http://www.gnu.org/software/classpath/. Most of the
          Standard classes for Java 1.2 (except Swing and RMI) are
          implemented by the ClassPath project

        * Most of the RMI classes are implemented by NinjaRMI
          http://www.cs.berkeley.edu/~mdw/proj/ninja/ninjarmi.html

        * Autoconf macros
          http://www.internatif.org/bortzmeyer/autoconf-Java/ helps easy
          recompilation of Java programs.

        * Mauve http://sourceware.cygnus.com/mauve/ is a free suite to test
          if these tools are 'compliant'.

     There is a list on free java at
     http://www.lists.deus.net/mailman/listinfo/free-java


2.3. JDK1.2
-----------

2.3.1. Why is not Sun's jdk 1.2 available?
------------------------------------------
     Due to license problems. Clause 2 of the license that comes with is
     says: 
     Software is confidential and copyrighted. Title to Software and all
     associated intellectual property rights is retained by Sun and/or its
     licensors. Except as specifically authorized in any Supplemental
     License Terms, you may not make copies of Software, other than a
     single copy of Software for archival purposes.

2.3.2. What are the problems with Suns' new license?
----------------------------------------------------
     Sun has moved to a new license the _Sun Community License_, like the
     GPL it is a viral license, but making all it touches subject to Sun
     licensing fee. The SCSL even goes so far as to define any
     implementation of a Sun specification as a "Modified Work". Basically,
     this means that if you implement any part of the new 1.2 API or Jini
     API, even from scratch, Sun will "own" your implementation and you
     will have to pay them for the right to use it. 
     13. "Modification(s)" means (i) any change to Covered Code; (ii) any
     new file or other representation of computer program statements that
     contains any portion of Covered Code; and/or (iii) any new Source Code
     implementing any portion of the Specifications.

2.3.3. Can I use jdk1.2 while working with the free java implementations?
-------------------------------------------------------------------------
     Clause 1 of the Supplemental License Terms says: 
     [You] may not create, or authorize your licensees to create additional
     classes, interfaces, or subpackages that are contained in the "java"
     or "sun" packages or similar as specified by Sun in any class file
     naming convention;

     Which seems to prevent one from making his own implementation of the
     standard java classes using the JDK.


2.4. IBM's jdk1.1
-----------------

2.4.1. Can Debian distribute IBM's jdk1.1?
------------------------------------------
     It seems not. It has the following license: 
     Program Code Consists of the IBM Developer Kit for Linux(R), Java(TM)
     Technology Edition, Version 1.1.8, in Binary Code form, as modified by
     IBM to run on the RedHat(R) 6.0 Linux or Caldera(R) OpenLinux 2.2
     Operating systems. The Program Code consists of the Java virtual
     machine, the Java platform core classes and supporting files (also
     known as the Java Runtime Environment or JRE) Java Tool Kit,
     Documentation and Java Samples. Program Code may include soft copy
     documentation, readme files, program data and such like. You may only
     use the Program Code if you are a current licensee of Redhat 6.0 Linux
     or Caldera OpenLinux 2.2 Operating systems and the Program Code may
     only be used in conjunction with such products.

     See bug #54641 for an issue about IBM JDK.

2.4.1.1. Is it possible to obtain a licence for Debian 2.1?
-----------------------------------------------------------

     It would still be non-free, because of item 8 in the DFSG "License
     Must Not Be Specific to Debian".


2.5. JRE
--------

2.5.1. Can Debian distribute JRE?
---------------------------------
     (from
     http://www.debian.org/Lists-Archives/debian-java-9908/msg00021.html) I
     don't think we can or want to distribute the JRE with Debian. The
     supplemental license terms of the JRE has a few very nasty clauses: 
     1. License to Distribute. You are granted a royalty-free right to
     reproduce and distribute the Software provided that you: (i)distribute
     the Software complete and unmodified, only as part of, and for the
     sole purpose of running, your Java applet or application ("Program")
     into which the Software is incorporated;
     We might get away with this one since we distribute it together with
     Java applications bundled with Debian. But we also do want to allow
     people to download only the jre package. 
     (ii) do not distribute additional software intended to replace any
     component(s) of the Software;
     But we cannot agree to this one. We want to distribute Kaffe, Japhar,
     Classpath, Gcj, Kopi, Fastjar, etc which are intended to replace the
     JRE with a Free version. Even if we don't consider non-free part of
     Debian (the JRE would not go into main :) I think we should not
     encourage software that tries to prevent Free replacements. 
     [...] (v) may not create, or authorize your licensees to create
     additional classes, interfaces, or subpackages that are contained in
     the "java" or "sun" packages or similar as specified by Sun in any
     class file naming convention;
     My example why this is a bad clause was not so good since someone
     pointed out that you do not want to create something that is non
     standard. I do agree that we want a standard implementation of the
     core classes, but I also think that you should have the freedom to
     create non-standard classes. (Or fix bugs or stupid mistakes in the
     standard classes.) 
     [...] and(vii) agree to indemnify, hold harmless, and defend Sun and
     its licensors from and against any claims or lawsuits, including
     attorneys' fees, that arise or result from the use or distribution of
     the Program.

     And I don't think that Debian (or SPI) can or wants to do that.

     So I am afraid that we also cannot distribute the Sun or Blackdown
     JRE. This isn't that bad since it is non-free software, but it is
     annoying. As I said before please help one of the (many) Free Java
     projects out there if you want to see a Free JVM, Standard Classes,
     Compiler, etc. in Debian. They are far from complete but they do work
     for most purposes


-------------------------------------------------------------------------------


3. Java Compilers
-----------------


3.1. What Java compilers are available in Debian?
-------------------------------------------------

        * `guavac'. The compiler of Effective Edge Technologies. This
          compiler is orphaned upstream, for real work use gcj or yikes.

        * `tya'. A just in time compiler

        * `gck'. Is this available?

        * `yikes'.

        * `bock'. Java to C compiler.

        * `gcj'. Compiles Java source to native code.



-------------------------------------------------------------------------------


4. Java Virtual Machines (JVM)
------------------------------


4.1. What jvms work in Debian?
------------------------------

     Currently only Sun's jdk. (But, for simple programs such as the ones
     used for teaching, the free kaffe VM may be enough. Another solution
     is to use gcj and to compile to native code, thus solving the VM
     problem.)


4.2. What free jvms are available in Debian?
--------------------------------------------

        * `kaffe'. Cannot run all programs, although it is alleged to run
          Jigsaw (a 10Mb distribution) see
          http://www.de.debian.org/Lists-Archives/debia
          n-java-9911/msg00038.html.



4.3. Are there know problems?
-----------------------------

        * Kaffe loops endlessly on the XML parsing.



-------------------------------------------------------------------------------


5. Java-related programs
------------------------


5.1. What java related programs are available in Debian?
--------------------------------------------------------

5.1.1. Deban 2.1 'slink'
------------------------

        * `vrwave'. A Java VRML browser.

        * `icq-java'. An installer for the ICQJava program.

        * `jde'. A Java Development Enviroment for Emacs.

        * `jlex'. A lexical analyser generator similar to the UNIX `lex'.

        * `mmake'. A generator of Makefiles for java programs.

        * `libpgjava'. A java class that enables communication with the
          PostgreSQL database using JDBC.

        * `cup'. A parser similar to `yacc'.

        * `ilu-javadev'. Development header and libraries for the
          Inter-Language Unification System.


5.1.1.1. I've installed the latest jde package...what I have to do to let
Emacs enter jde-mode automatically when loading a Java source file?
----------------------------------------------------------------------------

     As explained in /usr/doc/jde/README.Debian, all that is required is
     putting `(require 'jde)' into your `~/.emacs' file.

     Note that other add-on packages to Emacs are not enabled by default
     either, e.g., AucTeX.

5.1.2. Debian 2.2 'potato'
--------------------------

        * `fastjar' a complete replacement for the jar utility written in C
          under the GPL http://www.engr.orst.edu/~burnsbr/fastjar/ (check
          http://www.debian.org/Lists-Archives/debian-j
          ava-9908/msg00015.html


5.1.3. Is there a a free javadoc implementation? 
-------------------------------------------------

     You might take a look at http://www.zib.de/Visual/software/doc++/, it
     is package for Debian, alas, it is not on main.


5.2. What virtual packages could I use?
---------------------------------------

        * `java-common'. It is the Mother Of All Java Packages, in the
          proposed policy. It contains the text of the Policy (Docbook), as
          well as utilities scripts (for instance to build a CLASSPATH from
          a list of jars (submissions welcome).

        * `java-virtual-machine'

        * `java-compiler'
        * `java-compiler-dummy'.It is a small tool useful for the
          transition to the new Policy. Until all compilers comply with the
          Policy, java-compiler-dummy provides the following services: 

             * Provides: java-compiler so upper packages are happy,

             * set CLASSPATH before calling the real compiler.

        * `java-virtual-machine-dummy'.It is a small tool useful for the
          transition to the new Policy. Until all virtual machines comply
          with the Policy, java-virtual-machine-dummy provides the
          following services: 

             * Provides: java-virtual-machine so upper packages are happy,

             * set CLASSPATH before calling the real VM.



5.3. Making packages for java programs
--------------------------------------

5.3.1. Can the package go to main?
----------------------------------

     Since there is not yet a free java environment in Debian, the
     dependance on any package to JDK avoids any Java program to be in main
     even if it uses a free license, the program should be moved to
     contrib.


5.4. Installer packages
-----------------------

5.4.1. What Java programs have an installer?
--------------------------------------------

        * `vajava' is a visual IDE for Java. You can find it in
          http://software.ibm.com/ad/vajava._TODO: check copyright_. The
          installer can be found at
          http://www.dat.etsit.upm.es/~jfs/debian/vajava.

        * `ibm-jdk1.1'. Installer for IBM Developer Kit for Linux, Java(TM)
          Technology Edition This is an alpha version 1.1.6 of the IBM
          Developer Kit. The IBM Developer Kit is a development environment
          for writing applets and applications that conform to the Java 1.1
          Core API. Its compiler and other tools are run from a shell and
          have no GUI interface. . The IBM Developer Kit includes the IBM
          JIT (libjitc.so) which is used by all tools by default. Look for
          it in http://master.debian.org/~doko. Needs to be upgraded to
          1.1.8. However it seems that providing an installer might break
          their license (see section 2.4, `IBM's jdk1.1')

        * `jdk1.2-installer'. Look for it in
          http://www.pobox.com/~julio/debian/jdk1.2-installer/.


5.4.2. What Java programs could I develop an installer to?
----------------------------------------------------------

        * ¿?



-------------------------------------------------------------------------------


6. Java servlets
----------------


6.1. How can I make Java servlets work?
---------------------------------------
     You can use: 

        * GNUJSP

        * Apache Jserv



6.2. Do servlets work with kaffee?
----------------------------------

     The `servlet.jar' in Kaffe will not work. It is only a shell. There is
     another LGPL implementation that was written by Paul and Mark
     Wielaard. It is available at http://www.euronet.nl/~pauls/java/servlet
     these will have (have been?) added Apache JServ package so the user
     doesn't have to download Sun's classes any longer.


6.3. Do I need commercial Java in order to run servlets?
--------------------------------------------------------

     Not known. Possibly not, need to explain.


-------------------------------------------------------------------------------


7. Java policy
--------------


7.1. Is there a Java policy for Debian?
---------------------------------------

     It is still in the works. The current policy addresses _some_ of the
     problems. It has not been officially released. You can find it in
     http://www.debian.org/~bortz/Java/policy.html.


7.2. Are there Holes in the Java Policy?
----------------------------------------

     Yes, some until under discussion.Thus it is _very_ inconvenient to use
     serveral compilers of virtual machines since there is not one
     CLASSPATH setting for all.


-------------------------------------------------------------------------------


8. Running Java in Debian
-------------------------


8.1. Is there a way, using free software to run a Java program in Debian?
-------------------------------------------------------------------------

     Yes there is, since the problem currently now is the jvm you can try
     to run applications without a jvm. How? Compiling to native code is
     the solution.

8.1.1. How do I compile to native code?
---------------------------------------

     You might not be able to use gcj since it fails on many Java
     constructs, so you cannot compile the program directly. But you can
     compile with `jikes' (which is a free program, also), and use `gcj' to
     convert bytecode to native code. The entire sofwtare chain is free.

8.1.2. Are there any successes using this approach?
---------------------------------------------------

     Most certainly, read in
     http://www.debian.org/Lists-Archives/debian-java-9911/msg00044.html
     how this was done for the XML parser `xp'. 
ezili:~/infosystems/XML/Java> gcj --main=UnTag UnTag.java UnTagHandler.java
/usr/share/java/repository/org/xml/sax/helpers/*.class
/usr/share/java/repository/org/xml/sax/*.class /usr/share/java/repository/com/j
clark/xml/sax/*.class /usr/share/java/repository/com/jclark/xml/parse/*.class
/usr/share/java/repository/com/jclark/xml/tok/*.class
/usr/share/java/repository/com/jclark/util/*.class
/usr/share/java/repository/com/jclark/xml/parse/base/*.class

8.1.3. Are there any problems with this approach?
-------------------------------------------------

     Yes there are also some problems.

     `gcj' does not support JNI, and in previous inquiries to Cygnus, we
     did not get get the impression that JNI is a priority. IIRC Tom Tromey
     said that JNI could be implemented on top of CNI, and that outside
     contributors are welcome to add it.

     Lack of JNI affects use of Classpath (e.g. as an alternative to
     libgcj) as well as small, standalone apps that replace AWT with some
     really simple GUI (like using curses, e.g. for small installers). It
     also affects projects which have native code for performance reasons.
     At the moment, gcj basically forces a CNI port. The only alternative
     we are aware of is TowerJ, which is good for commercial projects, but
     does not offer anything to open source.

8.1.4. Does these work for architectures different than i386?
-------------------------------------------------------------

     Possibly not, since libgcj does not build on sparc and no one has
     tried this for arm.


-------------------------------------------------------------------------------


     Debian Java FAQ.

     Javier Fernández-Sanguino Peña <[EMAIL PROTECTED]>

     16 feb 1999

Reply via email to