Top

Building the Source


Using configure and make

For Linux:

    $ ./configure --with-jdk=DIR
    $ make
    $ make install
The --with-jdk option is always required, in order to specify which JDK to use (give the full path of its top-level directory).

You can use the --with-extensions option to specify extensions to the CLASSPATH. For example, you may want to build j with XML parser support:

    $ ./configure ... --with-extensions=/usr/share/java/xerces.jar
Extensions specified in this way are added to the CLASSPATH both during the build process and at runtime.

If you want to use certain experimental features such as shell and telnet buffers, you should specify the --enable-jpty option (you will also need to set enableExperimentalFeatures=true in your preferences file).

For Windows, you'll need the Cygwin tools, and you'll need to be running bash as your shell. You can use the Cygwin drive notation (if need be) to specify the location of your JDK:

    $ ./configure --with-jdk=//c/jdk1.3
In addition, you must specify the --unix option when invoking make:
    $ make --unix
    $ make --unix install
As an alternative, you can set the MAKE_MODE environment variable before running make:
    $ export MAKE_MODE=unix
    $ make
    $ make install
By default, j will be installed in /usr/local/bin, which may not be what you want if you're running Windows.

After you've built and installed j, you should be able to invoke it from the command line by just typing

    $ j
if /usr/local/bin is in your PATH.

If you're not using Java 1.4...

If you're not using Java 1.4 to build j, you'll get errors compiling the files MouseWheelListener.java and WindowStateListener.java (in src/org/armedbear/j). These files contain code specific to Java 1.4. These errors can safely be ignored. The classes in question will be loaded dynamically if they exist, but they are not required.

If you don't like the compilation errors, you can delete MouseWheelListener.java and WindowStateListener.java, use Java 1.4, or use the Ant-based build system (see below).

Using Ant

Starting with version 0.11.2, j also comes with an Ant-based build system. Version 1.4.1 of Ant is required.

Change into the root directory of the j source distribution and edit the file build.properties to suit your situation:

If you're not planning to use Java 1.4, you can leave jdk14 unset in build.properties; the source files that require 1.4 (MouseWheelListener.java and WindowStateListener.java) just won't get built in that case.

If you want to use Java 1.4 and you don't care about earlier versions of Java, the simplest thing to do is to point both jdk and jdk14 at your Java 1.4 JDK.

You can also point jdk at your Java 1.3 JDK and jdk14 at your Java 1.4 JDK, and the resulting j.jar will work with either 1.3 or 1.4; the distribution binaries are built this way.

Then:

    $ ant all
    $ ant install
This will install j in /usr/local/bin.

In theory, since Ant is a Java-based, cross-platform tool, the Ant build system should work on Windows too, but it has only been tested on Linux. Minor adjustments may be required to get it to work correctly on Windows.