<?xml version="1.0" encoding="ISO-8859-1"?>
<article id="paper-12320">
  <articleinfo>
    <title>GNU Classpath - The Free and Innovative alternative to the java programming language</title>
    <author>
      <firstname>Mark</firstname>
      <surname>Wielaard</surname>
    </author>
    <copyright>
      <year>2006</year>
      <holder>Mark J. Wielaard</holder>
    </copyright>
  </articleinfo>

<section>
  <title>What is GNU Classpath</title>
  
  <para><inlinemediaobject><imageobject><imagedata fileref="picture-12320-01.png" format="PNG"/></imageobject></inlinemediaobject></para>

  <para>GNU Classpath is an implementation of the essential core
  classes for the java programming language.  It is a Free Software
  library for the GNU platform.  It is an official GNU project with
  the FSF as custodian.  And the GNU answer to what Richard Stallman
  described as <ulink
  url="http://www.gnu.org/philosophy/java-trap.html">The Java
  Trap</ulink>.  It is a project to make the freedom to share, study,
  modify and integrate available to all Free Software hackers wanting
  to use the java programming language.  And it is a wonderful
  community of hackers having fun!</para>

  <para>The main drivers of the project are providing users the
  freedom to tinker with the full system, pushing innovation by
  creating an architecture that makes people do new things, creating
  an environment where collaboration is the norm and just doing cool
  stuff together.</para>

  <para>This has resulted in a large community of people (more than
  100 individuals and companies have contributed significant work now)
  and projects (almost 30) all working together. Through these various
  people and projects GNU Classpath has been integrated nicely within
  the various GNU/Linux distributions which have started to provide
  Free Software written in the java programming language based on the
  GNU Classpath core classes.</para>

</section>

<section>
  <title>Extending and enhancing the Free Software community</title>

  <para>One of the attractive features of the GNU Classpath core
  library is that it supports a very rich set of facilities. It
  provides Free Software developers a reasonably well designed,
  object-oriented framework that covers most needs of a typical
  application. The support ranges from abstract data types to
  graphical user interfaces, from low-level network abstractions to
  remote method invocation with over-the-network class loading, from
  mathematical libraries to database access.</para>

  <para>We think it is a nice extension to the rich Free Software
  environment that we already have. And if we manage to integrate all
  the good ideas (type-safety, modularity, object-oriented, rich core
  library, etc) nicely with the rest of the GNU system while
  maintaining compatibility with the java core libraries then we will
  reach more developers. Many people have already learned about the
  language and the standard library, by providing a free alternative
  we invite these people to join our community. And plenty of Free
  Software is already being written in the language. Just on
  SourceForge there are more than 12.000 Free Software projects. But
  there are certainly also arguments against it. Java has been
  over-hyped as a solution to everything, it has a bad reputation for
  wasting resources (cpu, memory), early implementations were slow, it
  looks like C/C++ and it doesn't integrate with any native
  platform. But we think we can (and have already) fix most of these
  issues while maintaining the good values.</para>

  <para>Richard Stallman said in <ulink
  url="http://www.gnu.org/gnu/manifesto.html">The GNU
  Manifesto</ulink> about why GNU is compatible with Unix: <quote>Unix
  is not my ideal, but it is not too bad. The essential features of
  Unix seem to be good ones, and I think I can fill in what Unix lacks
  without spoiling them. And a system compatible with Unix would be
  convenient for many other people to adopt.</quote> We hope that we
  have done the same with GNU Classpath. And that is why we make sure
  GNU Classpath is compatible with the core libraries for the java
  programming language.</para>

</section>
  
<section>
  <title>The eco system, or write once, run where?</title>
 
  <para>One of the cornerstones of the GNU system is the GNU Compiler
  Collection (GCC). GCC contains compilers, libraries and tools for a
  large number of programming languages such as C, C++, Objective-C,
  Fortran, Ada and java. The GCJ front end is combined with GNU
  Classpath as libgcj, the runtime library that provides threading,
  garbage collection and dynamic linking. So GCC provides a full free
  replacement for the java platform. One with some interesting
  properties because GCJ can used can be used in various modes to</para>
 
  <itemizedlist>
    <listitem><para>Compile and link <filename>.java</filename> source
    files to binaries, <filename>.o</filename> or
    <filename>.so</filename> files.</para></listitem>

    <listitem><para>Compile and link <filename>.class</filename> byte
    code files or while <filename>.jar</filename> class archives to
    binary.</para></listitem>

    <listitem><para>Compile <filename>.java</filename> source files to
    <filename>.class</filename> byte code files (<filename>gcj
    -C</filename>).</para></listitem>

    <listitem><para>Interpret <filename>.class</filename> or
    <filename>.jar</filename> byte code files during runtime
    (<filename>gij</filename>).</para></listitem> </itemizedlist>

  <para>The byte code interpreter is included as part of the
  <filename>libgcj</filename> runtime and can be used by programs to
  dynamically load and switch between interpreting byte code and
  executing natively compiled code on demand.</para>

  <para>And although GCJ is a very robust implementation which has
  been ported to a lot of platforms we didn't stop there. GNU
  Classpath is also used with more traditional Just In Time (JIT)
  systems like Kaffe or Cacao; pure byte code interpreters like JamVM
  and SableVM; runtimes and compilers written completely in the java
  programming language like the IBM Jikes Research VM; JNode, a full
  Operating System written in the java programming language; real-time
  systems like OVM; Jupiter, a VM for multiprocessor clusters (128
  CPU, Myrinet) and IKVM.NET, which translates java bytecode to the
  .NET Intermediate Language as used by Mono.</para>

  <para>The collaboration of these very diverse projects on a common
  core library has made GNU Classpath a very robust and extensible
  library. It allows us to share the development load by have a common
  bug tracking system and test-suites. And it allows people to
  experiment and try out various (optimization) ideas in completely
  different environments.</para>

</section>

<section>
  <title>Supporting diversity</title>

  <para>The diversity of projects based on GNU Classpath make for some
  interesting engineering challenges. There are a couple of very
  different (sometimes conflicting) design goals. And the platform
  that needs to be integrated with the core libraries can be very
  diverse (from Posix, GNU and Gnome to the .net C# libraries or
  almost bare metal). This means you don't just need a vm interface
  between the runtime and the core class library. You also need a
  platform interface to deal with differences in threading, keeping
  track of time, timezones, i/o, network, differences in underlying
  gui toolkits or how a platform handles mime-types, etc.</para>

  <para>To support this GNU Classpath has a delegate/facade pattern
  for various core or platform-dependent classes.</para>

  <para><inlinemediaobject><imageobject><imagedata fileref="picture-12320-02.png"
  format="PNG"/></imageobject></inlinemediaobject></para>

  <para>These <filename>VMClasses</filename> define a clear interface
  not just between the runtime and the core class library, but also
  signal were in the core class library there are platform-dependent
  hooks, or places for optimization. GNU Classpath comes with a full
  implementation of these classes for GNU/Posix-like systems with
  hooks to GTK+ (or Qt) for the (AWT) gui classes written in C and
  using the standard JNI interface. Different runtimes override some
  or even all of these to provide access to their own native platform
  layers.</para>

</section>

<section>
  <title>Correctness, completeness and compatibility</title>

  <para>One of the major focuses of the GNU Classpath project is
  expanding and using the free Mauve test suite for Compatibility,
  Completeness and Correctness checking.  Various groups around GNU
  Classpath collaborate on the free software Mauve test suite which
  contains almost 50.000 core library tests.  Mauve has various
  modules for testing core class library implementations, byte code
  verifiers, source to byte code and native code compiler tests.
  Mauve also contains the Wonka visual test suite and the Jacks
  Compiler Killer Suite. All these tests are continuously run on the
  development sources and carefully checked before each release to
  make sure no regressions occur. They can also be used to validate
  ports to new platforms.</para>

  <para>The current release of GNU Classpath is 0.90. The packages
  supported are mostly those of 1.4. In the last year we added support
  for the Swing gui toolkit, Corba, a full JCE crypto provider, CUPS
  support for printing and ALSA support for sound. ImageIO and
  Graphics2D are two places that still need some work (integrating
  with the Cairo graphics library). Work on supporting the new 1.5
  classes has already started on a separate branch. And we hope to
  have full 1.5 support in GNU Classpath by the end of this year. Most
  of the additional packages are already supported, most of the core
  library has been "genericized" on the branch, and there is a start
  of a new VM/Class interface for the generic and annotation
  reflection support. We also already have instrumentation and a VM
  interface for it. What is missing is sql.rowset support, text.html
  support and some of the newer ssl support, plus various new methods
  here and there, but all those don't need any exta runtime
  support. Things that need extra VM support are the new management
  (mx) and util.concurrency packages. There is a preliminary VM
  interface for the currency package already. Although one can use GDB
  for debugging we will also add support for JDWP to facilitate
  debugging with for example Eclipse.</para>

</section>

<section>
  <title>GNU Classpath on your GNU/Linux Desktop</title>

  <para>In the last couple of years various GNU/Linux distributions
  have started to bundle applications based on GNU Classpath. A very
  diverse set of applications and tools are now supported like office
  suites (OpenOffice), development environments (Eclipse),
  peer-to-peer applications (Azureus) and application servers (JOnAS
  and Tomcat).</para>

  <para>For developers there are several full free development system
  available now in modern GNU/Linux distributions. You can use GCJ to
  compile your applications to fast (production quality) machine code,
  but as part of the critically important GCC suite, releases are not
  as frequent to allow more time for testing. So the latest stable
  release of gcc 4.1 is still based on an older GNU Classpath. Other
  runtimes that have more traditional interpreter/jit designs, like
  Kaffe, Cacao and JamVM do more rapid releases and sometimes include
  more advanced features earlier. And recent releases of Mono come
  with IKVM.NET and GNU Classpath included to make integration of .net
  and java easy. The Gnome platform now includes official java-gnome
  bindings for integration with all the desktop features. All these
  work with the Eclipse integrated development environment which makes
  application development a joy.</para>

  <para>Our success has actually overwhelmed most GNU/Linux
  distributions which are now struggling with the number of new Free
  Software packages available. Take the eclipse development framework
  or the jonas application server for example.</para>

  <table frame="none" label="packaging">
    <title>Eclipse and Jonas package dependencies</title>
    <tgroup align="center" colsep="0" rowsep="0" cols="4">
      <colspec colname="c1"/>
      <colspec colname="c2"/>
      <tbody>
        <row>
          <entry align="center"><inlinemediaobject><imageobject><imagedata fileref="picture-12320-03.jpg" format="JPEG"/></imageobject></inlinemediaobject></entry>
          <entry morerows='1' align="center" valign='middle'><inlinemediaobject><imageobject><imagedata fileref="picture-12320-04.png" format="PNG"/></imageobject></inlinemediaobject></entry>
        </row>
        <row>
	  <entry align="center"><filename>ant-*, axis, bcel, classpathx-mail,
	  eclipse-ecj, eclipse-rcp, gcc-java, gjdoc, gnu-crypto,
	  jakarta-commons-*, java-1.4.2-gcj-compat, jessie, jsch,
	  ldapjdk, libgcj, log4j, mx4j, tomcat5-*, wsdl4j,
	  xml-commons-resolver, ...</filename></entry>
        </row>
        <row>
          <entry morerows='1' align="center" valign='middle'><inlinemediaobject><imageobject><imagedata fileref="picture-12320-05.png" format="PNG"/></imageobject></inlinemediaobject></entry>
          <entry align="center"><inlinemediaobject><imageobject><imagedata fileref="picture-12320-06.jpg" format="JPEG"/></imageobject></inlinemediaobject></entry>
        </row>
        <row>
	  <entry align="center"><filename>avalon-framework, avalon-logkit, axis,
	  bcel, carol, castor, classpathx-mail, eclipse-ecj, gjdoc,
	  gnu-crypto, hsqldb, jakarta-commons-*,
	  java-1.4.2-gcj-compat, jdom, jessie, jgroups, jonathan-core,
	  jonathan-jeremie, joram, ldapjdk, libgcj, log4j, mx4j,
	  objectweb-anttask, p6spy, struts, tomcat5-*, velocity,
	  werken.xpath, wsdl4j, xdoclet, xjavadoc,
	  xml-commons-resolver, ...</filename></entry>
        </row>
      </tbody>  
    </tgroup>
  </table>

  <para>Both these program have been build upon existing Free Software
  packages which are all supported now through GNU Classpath. These
  programs use the easy combining of Free Software modules written in
  the java programming language to the extreme and both depend (in
  complex ways) on more than 50 sub-packages (only the most
  significant have been shown in the table above). This puts a lot of
  work on the shoulders of the packagers and reviewers. That is one of
  the reasons why JOnAS isn't in all the latest distributions yet. It
  takes too much time for the various package reviewers to digest the
  influx of new tools into their distribution.</para>

  <para>One could say that we have succeeded in providing working code
  for a far range of existing Free Software projects written in the
  java programming language. The real challenge now is no longer
  producing working code (although help is still very much
  appreciated!). The applications that really matter do work on the
  free stack and are now included in the latest GNU/Linux
  distributions. The real problem now is the packaging and versioning
  of all that code. We are used to having pretty decent versioning and
  dependency control on GNU/Linux systems. That is not so in the
  traditional java world. The next challenge is sanely integrating the
  free java world with the GNU/Linux world. And finding a solution for
  the dependency and version problem that came with the liberation of
  all this cool new code. We are extremely happy that the major
  problem today is finding ways to sanely integrate and build the
  large and diverse set of Free Software that the community
  produced. And we hope your next Free Software project will be based
  on GNU Classpath and this rich set of libraries and tools build on
  top of it so that it will be included in your favorite GNU/Linux
  distribution in the future.</para>

</section>

<section>
  <title>Thanks and future reading</title>

  <para>GNU Classpath and all the projects around it would not be what
  it is today without the great and lively community it has. If you
  want to know more about it please visit the <ulink
  url="http://www.gnu.org/software/classpath/">GNU Classpath home
  page</ulink>. There is a list of <ulink
  url="http://www.gnu.org/software/classpath/stories.html">stories
  about projects</ulink> based on GNU Classpath. And you might enjoy
  the daily chatter of the various hackers on <ulink
  url="http://planet.classpath.org/">Planet Classpath</ulink>.</para>

  <para>For those interested in more technical details of the project
  there is the <ulink
  url="http://www.gnu.org/software/classpath/docs/hacking.html">GNU
  Classpath Hacker Guide</ulink>, the <ulink
  url="http://developer.classpath.org/mediation">GNU Classpath
  Developers Wiki</ulink> and the <ulink
  url="http://www.gnu.org/software/classpath/docs/vmintegration.html">Runtime
  Integration Guide</ulink>. And and (old) <ulink
  url="http://www.klomp.org/mark/classpath/slides/gnu_classpath_workshop.html">
  tutorial on Hacking VM Interface</ulink>.</para>

  <para>Hackers interested in using GNU Classpath for their own
  programs might want to check out the <ulink
  url="http://developer.classpath.org/doc/">GNU Classpath class
  documentation</ulink> and the <ulink
  url="http://gcc.gnu.org/onlinedocs/gcj/">GCJ manual</ulink>.</para>

  <para>The current status and a roadmap for most of the projects
  mentioned in this article can be found in <ulink
  url="http://developer.classpath.org/support/">Escaping the Java
  Trap: A practical road map to the Free Software and Open Source
  alternatives</ulink>.</para>

  <para>And please feel free to join our <ulink
  url="mailto:classpath@gnu.org">mailinglist</ulink> and/or our irc
  channel #classpath on irc.gnu.org.</para>

  <para><inlinemediaobject><imageobject><imagedata fileref="picture-12320-07.png" format="PNG"/></imageobject></inlinemediaobject></para>

</section>

</article>

