The Kawa release normally comes as a gzip-compressed tar file named
Two methods are supporting for compiling the Kawa sources;
choose whichever is most convenient for you.
One method uses the traditional GNU
followed by running
make. This works well on Unix-like
systems, such as GNU/Linux.
You can also use this method on Microsoft Windows,
as long as use http://www.cygwin.org/. Cygwin.
The other method uses the
ant command, a Java-based
build system released by Apache’s Jakarta project. This uses
build.xml file in place of
works on non-Unix systems such as Microsoft Windows. However,
ant method does not support all
the features of the
In your build directory do:
tar xzf kawa-1.14.tar.gz cd kawa-1.14
Then you must configure the sources. This you can do the same way you configure most other GNU software. Normally you can just run the configure script with no arguments:
This will specify that a later
make install will install the
.class’ files into
If you want them
to be installed someplace else, such as
specify that when you run configure:
./configure --prefix $PREFIX
If you have the GNU ‘
readline’ library installed, you might try
adding the ‘
--enable-kawa-frontend’ flag. This will build the
kawa’ front-end program, which provides input-line editing
and an input history. You can get ‘
readline’ from archives
of GNU programs, including ftp://www.gnu.org/.
If you have Swing installed, and want to use JEmacs (Emacs in Java),
also pass the
--with-swing flag to
If you have installed Kawa before, make sure your
does not include old versions of Kawa, or other classes that may
conflict with the new ones.
As-distributed, the Kawa source code requires Java 6.
If you only have Java 5, use the
If you want to add support for certain Java 6 features,
but produce a
.jar file that will execute under Java 5 do:
Note this requires that you build Kawa with Java 6.
In theory Kawa supports older versions of Java (such as JDK 1.4
or even 1.1), though this has not been tested in a while.
You use the appropriate
but you still need a Java 5 or later version of
to build Kawa. You then need to use a tool
on the Kawa
.jar to fix up Java 5 dependencies.
Contact the Kawa author if you want to be a tester for this.
Then you need to compile all the .java source files. Just run make:
This assumes that ‘
java’ and ‘
javac’ are the java interpreter
and compiler, respectively.
For example, if you are using the Kaffe Java interpreter,
you need to instead say:
It has been reported that parallel make doesn’t work,
so don’t use the
-j2 or above options.
If you configured with
may need to specify
For example on OS/X you need to do:
make READLINE_INCLUDE_PATH=-I/usr/local/unix/readline/include \ READLINE_LIB_PATH=-L/usr/local/unix/readline/lib
You can now test the system by running Kawa in place:
or you can run the test suite:
or you can install the compiled files:
This will install your classes into
$PREFIX/share/java (and its
$PREFIX is the directory you specified
to configure with the
--prefix option, or
/usr/local if you
did not specify a
To use the installed files, you need to set
$PREFIX/share/java/kawa.jar is in the path:
CLASSPATH=$PREFIX/share/java/kawa.jar export CLASSPATH
This is done automatically if you use the ‘
Kawa now includes an Ant buildfile (
Ant is a part of the Apache
If you don’t hava Ant installed,
get it from http://ant.apache.org/bindownload.cgi.
The build is entirely Java based and works equally well on *nix, Windows,
and presumably most any other operating system.
Once Ant has been installed and configured (you may need to set the
ANT_HOME environment variables), you should
be able to change to the directory containing the
and invoke the ‘
ant’ command. With the default settings, a
successful build will result in a
kawa-1.14.jar in the
There are a few Ant "targets" of interest (they can be supplied on the Ant command line):
This is the default, it does
Compiles all the files into
*.class files into the directory
specified by the
Builds a jar into into the directory
specified by the
Run Kawa in a GUI window.
Deletes all files generated by the build, including the jar.
There is not yet a
test target for running the testsuite.
The are various "properties" that control what
ant does. You can
override the on the command line or by editing the
build.properties file in the same directory as
For example the
build.dir directory tells
ant where to
build temporary files, and where to leave the resulting
file. For example, to leave the generated files in the sub-directory
build.properties is provided and it contains
comments explaining many of the options.
Here are a few general properties that help to customize your build:
Path to put the temporary files used for building.
Path to put the resulting jar file.
A suffix to add to the version label for your customized version.
Whether (true/false) the Javac "-g" option is enabled.
Whether (true/false) the Javac "-O" option is enabled.
Here are some Kawa-specific ones (all
See the sample
build.properties for more information on these.
If you change any of the build properties, you will generally want to do
ant clean’ before building again as the build is often not able to
notice that kind of change. In the case of changing a directory path,
you would want to do the
clean before changing the path.
A special note for NetBeans users:
For some reason the build-tools target which compiles an Ant task won’t
compile with the classpath provided by NetBeans.
You may do ‘
ant build-tools’ from the command line outside of NetBeans,
in which case you will not want to use the
clean target as that
will delete the tool files as well.
You can use the
targets as appropriate. Alternatively you can add
ant.jar to the
build-tools classpath by copying or linking it into a
directory in Kawa’s source directory (the one containing the
The GNU Compiler for the Java(tm) Programming Language (GCJ) is part of the GNU Compiler Collection (GCC). It can compile Java source or bytecode files into native code on supported systems. Version 4.1 or later of GCC is recommended, and only Intel x86-based Linux/GNU system have been tested with Kawa.
First, get and install GCC. Set
PREFIX to where
you want to install GCJ, and configure it with these options:
./configure --enable-threads --enable-languages=c++,java --prefix $PREFIX make bootstrap make install
gcj is in your path and refers to the newly-installed
version, and if needed, set
LD_LIBRARY_PATH to point to the
libgcj.so was installed:
PATH=$PREFIX/bin:$PATH LD_LIBRARY_PATH=$PREFIX/lib export LD_LIBRARY_PATH
To build Kawa, you need to specify
configure which tells it to use GCJ.
./configure --with-gcj --prefix $PREFIX
Then as before:
make make install
Alternatively, you can use configure option
--with-gcj-dbtool. This allows gcj to automatically
find the kawa shared libraries from the
ant method is recommended for building
Kawa under Microsoft Windows.
You may get an error message "
Out of environment space."
for a solution. Alternatively you can run
org.apache.tools.ant.Main directly from the Ant jar.
make process assumes a Unix-like
environment. The free Cygwin
environment can be used for building Kawa: The Kawa configure script
recognizes Cygwin, and modifies the classpath to use Windows-style
path separators. (At the time of writing there were still some
path issues with running the testsuite.)
MinGW may also work but has not been tested.