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
Please note that this does not mean you cannot help GNU Classpath at all in such a case. Here is a list of things you can do instead:
Here are some rough guidelines for deciding whether or not it would be wise to accept a contribution from someone that studied source code for another implementation of the core libraries or is under contract with some company covering implementations of core library classes.
If the developer got access to the source code by signing some contract (like the SCSL) with Sun then it would be best to examine that contract (by FSF legal) before deciding.
If the developer just accidentally saw some of the source code and had no intention (and didn't actually) study the implementation (with the intention of contributing to GNU Classpath) there is no problem.
Studying a proprietary implementation with the intention of implementing it (better) for GNU Classpath is a clear no-no. The general rule is that if you have looked at or studied any (proprietary) implementation of a package you should not work on that package for GNU Classpath. That is because it would be difficult to proof that you really did an independent implementation. Since what you create might look very similar (which is not unlikely). Working on something completely unrelated is OK (as long as there are no contractual obligations with Sun or some other company to not do this of course).
The important thing is that we want to be clear on the fact that we created an independent implementation. We don't want to get into tricky legal situations. We want to avoid risking to go to court over reverse engineering or clean room situation questions if not absolutely necessary. That is why we in general just say "please don't contribute if you looked at other implementations". If someone thinks that their actions might be explained as copying directly or indirectly another (proprietary) implementation then that could be a problem that we want to avoid.
FSF Legal will always advise not to take any unnecessary risks that might endanger the (perceived) free software status of a GNU project. (If we might need to go to court to proof that what we did was OK, then don't!)
This isn't a GNU Classpath project specific issue.
See
Giving the copyright to the FSF also gives us a clear paper trail where changes come from, which confirms our clean-room status.
The assignment contract commits the foundation to setting distribution terms that permit free redistribution.
The assignment contract we normally use has a clause that permits you to use your code in proprietary programs, on 30 days' notice. (The 30 days' notice is there because, through a legal technicality, it would improve our position in a suit against a hoarder.) Although we believe that proprietary software is wrong, we include this clause because it would serve no purpose to ask you to promise not to do it. You're giving us a gift in the first place.
You don't need to invoke this clause in order to distribute copies as free software under the GNU GPL, since everyone is allowed to do that.
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
lib/standard.omit
controls which files are omitted from the compilation. Add a regex with the files to be omitted and rebuild classpath.
To modify and upload GNU Classpath's web pages, you need write access to the CVS. First, checkout the modules "classpath" and "website".
The web pages are stored in doc/www.gnu.org and are written in wml (Web Meta Language, see A typical page usually looks like this:
Invoking "make" creates the html pages in the same directory. To copy those pages to another directory, use
The steps to publish the pages are:
Note that it takes up to an hour for the pages to appear on the GNU website after an upload.
\#include "include/layout.wml"
<subject "here goes the page title">
<box>
<boxtitle>Section 1 Title<\boxtitle>
<boxitem>
section 1 contents
<\boxitem>
....
<\box>
> export CLASSPATH_WEBROOT=...destination...
> make publish
Only the proprietary VM's vendor can make it work with GNU Classpath, by the nature of the VM being proprietary. GNU Classpath provides well documented and widely used interfaces for interfacing with runtimes. It's up to proprietary VM vendors to make their products work with GNU Classpath, if they wish to do so. If you, as a customer, want the runtime to use GNU Classpath, please talk to your proprietary software vendor.
You can also try using a free runtime that supports GNU Classpath out-of-the-box instead.
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 :ext:anoncvs@savannah.gnu.org:/cvsroot/cp-tools module gjdoc
libxmlj CVS :ext:anoncvs@savannah.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.
Alternatively, you may also try the following command (the one used to generate the doc on
$(GJDOC) -public -use \
-sourcepath "$(sourcepath)" \
-encoding UTF-8 \
-breakiterator \
-licensetext \
-linksource \
-splitindex \
-d html \
-doctitle "GNU Classpath $(VERSION)" \
-windowtitle "GNU Classpath $(VERSION) Documentation" \
-header $(classpathbox) -footer $(classpathbox) \
-subpackages java:javax:org