GNU Classpath is a set of essential libraries for supporting the Java programming language.
Classpath serves the same role that libc has for C, but is much richer in functionality. The broadness of the standard library is an important reason why Java has been so successful. For example, the library includes frameworks to convert between character encodings, for accessing relational databases, for building Graphical User Interfaces, for encryption, for logging, and for numerous other tasks that are needed to build complex applications.
On the GNU operating system, we want to run software independent of the programming language in which it was written. Because Java is widespread, and because Java has some nice features, we want to support Java as well.
Sun Microsystems, the company who has created Java, currently distributes the “Java Development Kit” and “Java Runtime Environment” at no cost. The former even comes with the source code of the standard class library. However, the “Sun Community Source License” does not grant essential freedoms, for example the right to distribute a modified version of the code.
Therefore, Sun’s implementation does not qualify as Free Software.
Though it would be helpful if Sun would open their sources, this is not the most important step toward a free Java. Even more important for a free Java are:
There was already a lot of discussions around this topic on other sites:
GNU Classpath is a free implementation of Java’s standard
library. To execute Java programs, it is also necessary to have a
Java Virtual Machine (JVM). This component manages memory, enforces
security restrictions, compiles Java bytecodes to the instruction set
of your computer, and provides other runtime services. There exist
several projects for
Java programs can also be compiled “ahead of time,” like C++ or other compiled languages. The GNU Compiler Collection (GCC) does this, and its Java library is mostly derived from GNU Classpath.
Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination.
As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.
If you combine GNU Classpath with independent modules to produce an executable you can copy and distribute the resulting executable under terms of your choice.
So you can use and distribute GNU Classpath as is in your program without changing the license of your software.
See the documentation page, especially the GNU
Classpath Hacker’s Guide, and pick up a
Giving the copyright to the FSF also gives us a clear paper trail where changes come from, which confirms our clean-room status.
See also http://www.gnu.org/licenses/why-assign.html.
For getting the assignment form, please send an e-mail with your name (as it appears in your passport) and your current postal address to the maintainer of GNU Classpath, Mark Wielaard .
Follow these steps to install GNU Classpath. Please note that you need this only if you want to work directly with it; usually JVMs contain a pre-packaged version of GNU Classpath.
--help
to get the list of options: you will usually need --prefix=dest/dir/for/classpath; use
--disable-gtk-peer
if you don't use gtk+/gnome.
- echo gnu.testlet.java.lang.String.getBytes | jamvm
gnu.testlet.SimpleTestHarness
A particular problem is posed by OutOfMemoryException: throwing it shouldn't require any memory (there's none anyway). Some propose that the VM should preallocate it at bootstrap, but this doesn't solve the problem. In Chris Gray's words "if several threads throw OOME at the same time, the stack traces can get mixed up [...snip...] This situation is less improbable than you might think, since if one thread encounters an OOM situation, all other threads should encounter one too. With some forms of co-operative multi-threading you may get away with it, but in the general pre-emptive case you could be living dangerously."
gjdoc CVS :pserver:anoncvs@subversions.gnu.org:/cvsroot/cp-tools module gjdoc
libxmlj CVS :pserver:anoncvs@subversions.gnu.org:/cvsroot/classpathx module libxmlj
make && make install
System.setProperty("javax.xml.transform.TransformerFactory",
"gnu.xml.libxmlj.transform.TransformerFactoryImpl");
find * -name \*.java | xargs gcj -O2 -g -o gjdoc \
--main=gnu.classpath.tools.gjdoc.Main
#!/bin/sh
CLASSPATH=/home/mark/src/libxmlj:/home/mark/src/gjdoc/src/resources \
LD_LIBRARY_PATH=/usr/local/libxmlj/lib \
/home/mark/src/gjdoc/src/gjdoc $*
There is one catch. The above setup is completely broken for some HTML entities (see [bugs #4823] HTML entities such as auml and nbsp should be put back in the API doc). So if you have spectacular and mysterious crashes then make sure that your java source files don't contain such entities.