1 This directory contains example programs that show how the GNU Classpath
4 Each example has its own package under gnu.classpath.examples and has a
5 class Demo which contains a main() method to run that particular example.
7 The examples can be compiled and run with gcj as follows:
9 gcj -o swingdemo --main=gnu.classpath.examples.swing.Demo \
10 gnu/classpath/examples/swing/Demo.java \
11 gnu/classpath/examples/swing/GNULookAndFeel.java
14 Or with a traditional byte code interpreter like:
16 gcj -C gnu/classpath/examples/awt/Demo.java
17 gij gnu.classpath.examples.awt.Demo
19 The installation also comes with an examples.zip archive that contains
20 all needed resources and compiled byte code class files that can be
23 kaffe -classpath examples.zip gnu.classpath.examples.awt.Demo
24 kaffe -classpath examples.zip gnu.classpath.examples.swing.Demo
26 The jawt Demo needs some extra support library that currently needs to be
27 build by hand. The following assumes GNU Classpath was installed in
28 /usr/local/classpath, if you installed it somewhere else then adjust the
29 -I and -L paths accordingly. The included Makefile.jawt is setup this way.
31 You can invoke it with:
35 Or you can compile by hand as follows:
37 gcj -C gnu/classpath/examples/jawt/DemoJAWT.java
38 gcjh -jni gnu.classpath.examples.jawt.DemoJAWT -o DemoJAWT.h
39 gcc -g -O0 -Wall -I. -I/usr/X11R6/include -L. -L/usr/X11R6/lib \
40 -I/usr/local/classpath/include -L/usr/local/classpath/lib/classpath \
41 -lX11 -ljawtgnu -shared -o libDemoJAWT.so \
42 gnu/classpath/examples/jawt/DemoJAWT.c
44 You can then run the example as follows:
46 export LD_LIBRARY_PATH=.:/usr/local/classpath/lib/classpath
47 jamvm gnu.classpath.examples.jawt.DemoJAWT
49 All example code is distributed under the GNU General Public License (GPL).
51 The example icons used in some of the examples come from gnome-icon-theme
52 version 1.2.3 and are also distributed under the GPL.
53 All these images are stored in the directory gnu/classpath/examples/icons/.
55 More free icons can be found in the gnome-icon-theme package:
56 http://ftp.gnome.org/pub/GNOME/sources/gnome-icon-theme/
59 GNU Classpath examples are free software; you can redistribute it
60 and/or modify it under the terms of the GNU General Public License as
61 published by the Free Software Foundation; either version 2, or (at
62 your option) any later version.
64 GNU Classpath examples are distributed in the hope that they will be
65 useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
66 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
67 General Public License for more details.
69 You should have received a copy of the GNU General Public License
70 along with GNU Classpath examples; see the file COPYING. If not,
71 write to the Free Software Foundation, 51 Franklin Street, Fifth Floor,
72 Boston, MA 02110-1301, USA.