Go to the first, previous, next, last section, table of contents.


Building and installing Kawa

Before installing Kawa, you must have Java working on your system.

You can compile Kawa from the source distribution. Alternatively, you can install the pre-compiled binary distribution.

Getting and running Java

You will need a working Java system. The discussion below assumes you are using the Java Developer's Kit (JDK) version 1.1.x from JavaSoft (Sun). (Kawa has also been reported to work with Kaffe, Symantec Cafe, J++, and JDK 1.2beta.) You can download free copies of JDK 1.1.x for various platforms.

If you want to run Kawa on a Macintosh, see http://home.earthlink.net/~athene/2/scheme/mackawa.html.

The program java is the Java interpreter. The program javac is the Java compiler, and is needed if you want to compile the source release yourself. Both programs must be in your PATH.

You also need to set CLASSPATH so it includes both the current directory, and the standard Java library. After you have installed Kawa, the CLASSPATH needs to include wherever you installed Kawa.

If you have the JDK in directory $JDK, and you are using a Bourne-shell compatible shell (/bin/sh, ksh, bash, and some others) you can set both variables thus:

PATH=$JDK/bin:$PATH
CLASSPATH=.:$JDK/lib/classes.zip
export PATH CLASSPATH

Installing and using the binary distribution

The binary release includes only the binary compiled `.class' versions of the same `.java' source files in the source release. It does not include any documentation, so you probably want the source release in addition to the binary release. The purpose of the binary release is just to save you time and trouble of compiling the sources.

The binary release comes as a .zip archive `kawa-1.6.60-compiled.zip'.

You can unzip the archive, or you can use it as is. Assuming the latter, copy the archive to some suitable location, such as /usr/local/lib/kawa-compiled.zip.

Then, before you can actually run Kawa, you need to set CLASSPATH so it includes the Kawa archive. On Unix, using a Bourne-style shell:

CLASSPATH=/usr/local/lib/kawa-compiled.zip
export CLASSPATH

On Windows95/WindowsNT, you need to set classpath in a DOS console. For example:

set classpath=\kawa\kawa-1.6.60-compiled.zip

Then to run Kawa do:

java kawa.repl

To run Kawa in a fresh window, you can do:

java kawa.repl -w

On Windows, you probably do want to use the -w flag, because if you run Kawa under the MS-DOS prompt, you won't see commands echoed until you hit Enter. (If anyone knows a way to fix this problem, please let me know.)

Installing and using the source distribution

The Kawa release normally comes as a gzip-compressed tar file named `kawa-1.6.60.tar.gz' .

In your build directory do:

tar xzf kawa-1.6.60.tar.gz
cd kawa-1.6.60

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:

./configure

This will specify that a later make install will install the compiled `.class' files into /usr/local/share/java. If you want them to be installed someplace else, such as $PREFIX/share/java, then 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 installed Kawa before, make sure your CLASSPATH does not include old versions of Kawa, or other classes that may conflict with the new ones.

Thus you need to compile all the .java source files. Just run make:

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:

make JAVA=kaffe

You can now test the system by running Kawa in place:

java kawa.repl

or you can run the test suite:

(cd testsuite;  make check)

or you can install the compiled files:

make install

This will install your classes into $PREFIX/share/java (and its sub-directories). Here $PREFIX is the directory you specified to configure with the --prefix option, or /usr/local if you did not specify a --prefix option.

To use the installed files, you need to set CLASSPATH so that $PREFIX/share/java is on the path:

CLASSPATH=$PREFIX/share/java
export CLASSPATH

This is done automatically if you use the `kawa' script.

Building Kawa under Windows

The Kawa configure and make process assumes a Unix-like environment. If you want to build Kawa from source under Windows (95, 98, or NT), you could use a Unix empulation package, such as the free Cygwin. However, there are some problems with filenames that make this more complicated than it should be.

The Kawa source distribution now includes a simple batch file for building Kawa under Windows. You can do the following:

  1. Download the Kawa source distribution kawa-1.6.60.tar.gz.
  2. Extract the files using an appropriate tool. (I did tar xzf kawa-1.6.60.tar.gz, using the tar that is part of Cygwin. If there are alternative commonly-available tools, please let me know about them.)
  3. In an MS-DOS window, cd kawa-1.6.60.
  4. Edit makekawa.bat if need be to specify the location of your Java tools.
  5. Execute makekawa.bat.
  6. If this succeeded, you should have a working kawa. For example you can do java kawa.repl -w, assuming java is in your PATH.

If you use an integrated Java development environment, you should be able to import all the Java source files, and have it compile all of them. You then need to compile the builtin Scheme procedures:

cd kawa\lib
%KAWA% -d ..\.. -P kawa.lib. -C *.scm


Go to the first, previous, next, last section, table of contents.