This page demonstrates how one can experience results of our ongoing effort. Free applications formerly shackled in the Java trap enter a new life in a completely free environment. Any workarounds will be removed as our software stabilizes. Stay tuned!
This is a tribute to all fellows who helped to make this possible and a demonstration of the good powers of Free software development.
Besides all the exciting and nice technical stuff on this page please do not forget that this has been provided to you by a community enthusiastic about software freedom: Please share and enjoy!
Index
Contents
Qt4 based AWT peers
- Last edit: 2005-09-14
- Description:
Since GNU Classpath 0.18 we support the new Qt library version 4 for the AWT peers. This means that all visual representations of java.awt.Frame, java.awt.Button etc. are drawn and handled by the Qt library. Although Qt4 is clearly supported by GNU Classpath' build infrastructure most operating system do not ship it yet. The following paragraphs describe what you need to do in order to experience our free Qt4 drawn AWT:
The first step is to download, compile and install Qt 4.0.1 and no version below. We recommand installing it to a location inside your home directory by using the --prefix at configure time. For the rest of the discussion assume that ${QT4} is the directory where you installed the library.
Prepend ${QT4}/bin} to your PATH variable and make sure that moc -v tells you it is version 4.0.1 .
Add ${QT4}/lib to the LD_LIBRARY_PATH variable (or use an equivalent mechanism on your OS)
Add ${QT4}/lib to your PKG_CONFIG_PATH variable.
Do autoreconf in Classpath' source directory.
Invoke configure with --with-qt-peer (and all the other options you want).
- Download, build and install GNU Classpath 0.18.
Note: Insert #include <assert.h> in native/jni/qt-peer/componentevent.cpp before compiling GNU Classpath 0.18 to fix a build issue.
Run an AWT application and set the system property awt.toolkit to gnu.java.awt.peer.qt.QtToolkit.
E.g. to run Classpath AWT Demo application you could use JamVM 1.3.3: jamvm -cp examples.zip -Dawt.toolkit=gnu.java.awt.peer.qt.QtToolkit gnu.classpath.examples.awt.Demo
Eclipse - A kind of universal tool platform - An open extensible IDE for anything and nothing in particular
- Last edit: 2005-09-14
- Description:
- The GNU Classpath team is very proud to get this famous and free development environment to run basically out of the box.
Install Eclipse 3.1 and get your hands on a newer GCC 4.0 snapshot (building instructions, some distributions already ship pre-released versions of GCC 4.0 in their experimental section) or use JamVM 1.3.3 + GNU Classpath 0.18. I strongly suggest a precompiled Eclipse version or one that ships with your distribution. Building Eclipse from source is a very complex task that I am not going to describe here.
Note: For GCJ4 make sure you have adjusted PATH and LD_LIBRARY_PATH according to the building instructions.
- Enter the Eclipse installation directory and run it like this:
- For GCJ:
./eclipse -consoleLog -debug -vm gij
- For JamVM:
PATH=.:${PATH} ./eclipse -consoleLog -debug -vm jamvm -vmargs -mx256m(It prevents a problem where startup.jar can not be found and a OutOfMemoryError is thrown.)
Note: On Gentoo GNU/Linux the executable will be eclipse-<TK> where <TK> is gtk or motif.
To get Eclipse to run on Kaffe you have to build it from CVS and use a start-script. See this mail for details.
- References:
Purely historical instructions from Mark Wielaard from December 2002 the result has matured a lot since then.
Native Eclipse - The Fast and the Furious IDE
- Last edit: 2005-08-31
- Description:
- Now that you got Eclipse running you might be interested in how fast native compilation is? Well, read on.
For native compilation and execution you need GCJ, of course. Please see the install instructions in the previous issue. Experimenting around with a system wide installation of Eclipse is not a good thing. I suggest you to copy the whole Eclipse directory somewhere into a place for experiments in your home directory. Then enter the directory and put the following script in a text file:
#!/bin/sh libdir=${libdir:-lib-native} if ! test -e eclipse.db; then gcj-dbtool -n eclipse.db recreate_db=yes else recreate_db=no fi for JAR_FILE in `find -iname "*.jar"`; do thislib_destdir=${libdir}/$(dirname ${JAR_FILE}.so) thislib_destfile=${libdir}/${JAR_FILE}.so if ! test -e ${thislib_destfile}; then test -e ${thislib_destdir} || mkdir -p ${thislib_destdir} echo -n "Compiling ${JAR_FILE} to native ... " gcj -shared -findirect-dispatch -Wl,-Bsymbolic -fjni -fPIC \ -o ${thislib_destfile} ${JAR_FILE} echo -n "adding to eclipse.db ... " gcj-dbtool -a eclipse.db ${JAR_FILE} ${thislib_destfile} echo "[OK]" else echo -n "${JAR_FILE} already compiled" if test "x${recreate_db}" = xyes; then echo -n ", but not in eclipse.db, adding ... " gcj-dbtool -a eclipse.db ${JAR_FILE} ${thislib_destfile} echo "[OK]" else echo " and in eclipse.db, [OK]" fi fi doneYou can override the default directory where compiled libraries will be stored by setting the "libdir" variable:libdir=lib ./file-that-you-saved-the-script-to
But the default (lib-native) should be fine, so this is sufficient:./file-that-you-saved-the-script-to
Now run this script (remember to run it from the directory where you copied Eclipse to) and go drinking a coffee because this will take a while. If the compilation fails for whatever reason and you want to try it again, simply rerun the script and it knows what already has been compiled and does not waste time recompiling it again. The version I am using here has 146 Jar files which sums up to 36 MiB of (compressed) class data. When everything went fine you will have a gcj database file with mappings from the bytecode Java classes to their native counterparts. This database is in a file named eclipse.db. Run Eclipse with the following command to experience the amazing power of native compilation:
./eclipse -consoleLog -debug -vm gij -vmargs -Dgnu.gcj.precompiled.db.path=eclipse.db
Convinced?
Btw: This great stuff is included in Fedora Core 4 and is very likely to to be added to other distros like Ubuntu, too.
Btw2: Debian Users may want to apt-get install gcj-4.0 gcc-4.0 gcc-snapshot and replace gcj and gcj-dbtool with {gcc-4.0 and /usr/lib/gcc-snapshot/bin/gcj-dbtool
- Now that you got Eclipse running you might be interested in how fast native compilation is? Well, read on.
Apache Ant - The Java-based build tool
- Last edit: 2005-03-02
- Description:
Ant ("another neat tool") was made to overcome limitations of Makefile based systems. For a long time the new tool was dependent on non-free runtimes. I will show a simple way of calling Ant from the command line and what you have to take care of. My hope is that people from various distributions read about this and find a way to integrate support for GNU Classpath-based VMs and GCJ into the existing wrapper scripts which have been written for Ant. If you do not use GCJ then it will be likely that you will use a VM like JamVM for running programs and Jikes as the compiler. The correct command line will have the following features:
the executable is not java but jamvm (or similar)
the default compiler is set to jikes by specifying the property build.compiler
the property jikes.class.path points to the GNU Classpath class files or its archive file
If Ant's library files are installed in /usr/share/ant-core/ the command line will look like this:
jamvm -classpath /usr/share/ant-core/lib/ant-launcher.jar -Dant.home=/usr/share/ant-core -Dbuild.compiler=jikes -Djikes.class.path=/usr/share/classpath/glibj.zip org.apache.tools.ant.launch.LauncherWhen using GCJ and GIJ things will be a bit easier:
gij -classpath /usr/share/ant-core/lib/ant-launcher.jar -Dant.home=/usr/share/ant-core -Dbuild.compiler=gcj org.apache.tools.ant.launch.LauncherOf course Ant runs natively compiled. See the GCC Wiki for generic instructions on this. When running Ant this way do not forget to specify the gcj database file using the gnu.gcj.precompiled.db.path property.
JFreeChart
- Last edit: 2006-05-06 (dgilbert)
- Description:
JFreeChart functions quite well with recent versions of GNU Classpath from CVS (from 5-Jun-2006). See http://www.jfree.org/jfreechart/samples-gnu.html.
StatCVS
- Last edit: 2005-12-08
- Description:
StatCVS functions quite well with recent versions of GNU Classpath and Cairo (plus the cairo-java bindings). See http://www.object-refinery.com/classpath/statcvs.html.
