Gnome-GCJ
Gnome-GCJ is a set of GTK+ and Gnome bindings for Java. It compiles with the GCJ compiler (part of gcc) and uses the GCJ runtime library libgcj. GCJ is capable of compiling Java source code to native machine code, which makes Java code almost as fast as C++ code. As the interface between Java and GTK+, CNI (Cygnus Native Interface) and C++ will be used instead of the more traditional JNI and C. This means that support for other Java runtimes has been sacrificed in favour of GCJ and its faster CNI.
In these documents, numbers in brackets indicate a reference to an external document or site. There is a list of all the links in the LINKS document.
Gnome-GCJ is hosted on SourceForge [8]. The homepage with downloads, bug tracking system, mailing lists etc can be reached via the summary page [9].
The Gnome-GCJ project was started by me, Oskar Liljeblad, on 2000-07-15. My email address is osk@hem.passagen.se. Feel free to send me questions, comments, suggestions, bug reports, patches or whatever. I would like to know what you think about Gnome-GCJ - the code generation, the Java GDK/GTK+/Gnome API, the documentation, and the project in general. Please give me some feedback. :)
About this release
The only reason the 0.16.0 release was made was the change of licensing.
The current release of Gnome-GCJ is a development release, and should be treated as alpha or beta quality. Many changes are likely to be made to the Java GTK+/Gnome API. However, it is still usable - most Gtk widgets are implemented. Gdk is coming along nicely, and the Gnome port has just been started. Autoconf and automake support is now as complete as possible - libtool is used to build libraries and `make install' works correctly.
Gnome-GCJ is progressing quickly, so except many releases in the future.
Copyright and License
See the COPYRIGHT and LICENSE files.
Requirements
The names in braces are the corresponding Debian packages.
GTK+ (libgtk1.2, libgtk1.2-dev)
1.2.x is required.
Web site [11]
Download [12]
GLib 1.2.x (libglib1.2, libglib1.2-dev)
1.2.x is required.
Web site [11]
Download [12]
libgcj (libgcj4, libgcj-common, libgcj-dev)
A recent snapshot is required; anything not older than a month should do.
Note that you need the source code from libgcj in order to compile
Gnome-GCJ (some header files are required).
Web site [2]
Download [3]
gcc (gcc)
A recent snapshot is required; anything not older than a month should do.
You will need the C, C++ and Java (gcj) compilers from the GNU compiler
collection (gcc).
Web site [13]
Download [4]
gperf 2.7 or later (gperf)
This is needed for generating a perfect hash of Gtk class names. In
future versions of Gnome-GCJ this may not be needed, because generated
files would already be in the distribution tar-ball.
Download [19]
As of version 0.1.1 of Gnome-GCJ, a Java 2 runtime environment is no longer required. Neither is a Java 2 compiler - everything is compiled with GCJ. I strongly recommend to use the series 3 of the gcc and the corresponding gcj.
Compilation and Installation
Take a look at the INSTALL file for detailed instructions on the installation process.
To compile Gnome-GCJ, run "configure" followed by make:
$ ./configure
$ make
If there was no errors from the compilation, you can run some test programs by changing to the `test' directory. Because Gnome-GCJ is not installed yet, you must tell the dynamic linker where it can find the generated libraries. This is done by first setting LD_LIBRARY_PATH, like this:
$ cd test
$ export LD_LIBRARY_PATH=../src/gnu/gdk:../src/gnu/gtk:$LD_LIBRARY_PATH
$ test/CListDemo
There is a special make target `run' which you can use in the `test' directory to run a (pre-set) test program.
If the compilation fails or if some test program doesn't run, please send me an email and tell me what went wrong (include output of the make process).
Gnome-GCJ can be installed with `make install'. This will install the following files:
- Shared and static libraries in the library directory. This is usually /usr/local/lib, but can be set with the configure option --libdir (or --prefix).
- C++ header files for classes in the include directory. This is usually /usr/local/include, but can be set with the configure option --includedir (or --prefix).
- Java bytecode files for classes in the directory 'java/repository' or 'java' in the data directory. (If 'java/repository' exists, use that, otherwise use 'java'). The data directory is usually /usr/local/share. The Java bytecode directory can be set with the configure option --with-java-share.
Directory layout
The source distribution tarball of Gnome-GCJ has the following structure:
generate/
This directory contains Java source files for the generation process.
generate/java/
This directory contains compatibility classes from Classpath. These are
mainly the Collections framework in java.util, which is required by the
generator classes. Note that all of these may not be necessary at the
moment, however they may be in the future.
generate/org/gjt/osk/
This directory contains various utility classes created by me.
These classes are used by the classes in generate/ only.
I sometimes refer to some of these as 'Oskar Liljeblad's utility library'. Classes here are a couple of "static" classes: Strings and Justify which have some useful string manipulation methods, Collections2 and Arrays2 which contain additional methods for manipulating lists, sets, maps and arrays. A framework for generating source code files - JavaSourceWriter and IndentWriter - lives in org.gjt.osk.jsw.
src/
This directory contains the gtk.defs file and C++ code which is used by
the native code (such as cnisupport.cc and gtksupport.cc), as well
as some other files.
Note that there used to be a directory `out' that all generated/ compiled files would be placed in. Because of automake/autoconf, this is now the same as the source directory. It is currently not possible to build Gnome-GCJ in a directory other than the source directory (which is why `make distcheck' fails), but this is something that probably will change in the future.
src/gnu/gdk, src/gnu/gtk, src/gnu/gnome These directories contains source files which are used as input for the generate programs. A .defs file is used to generate a Java class for a certain Gtk class. There are also some .java files in these directories, along with package.html files for javadoc generation.
test/
This directory contains demonstration programs for Gnome-GCJ.
docs/
This directory contains documentation for Gnome-GCJ, as well as the
license and copyright documents.
macros/
Directory with certain files used by automake/autoconf.
Known problems
See the document "KNOWN_PROBLEMS" in the docs directory for a list of known compilation and runtime issues.
Further details
For more information on Gnome-GCJ, see the INTERNALS document. Or email me.
-
