Java+ Preprocessor Release 2.0

Java+ is a free (open source) Java preprocessor that supports multi-line strings with executable inclusions in Java as in Perl, Ruby, and Python. It is available for download here.

Usage Example

Usage Diagram

The box on the left is the source directory (srcDir), typically with nested subdirectories in accordance with the usual java package conventions. The srcDir contains Java+ source files (with the digraph-based string synax described in the Syntax section). The srcDir can contain non-Java+ files that should not be preprocessed or compiled, just copied to the jar so the classloader can find them (properties files, image files, etc). The srcDir can also contain files that should be skipped altogether (CVS directories, backup copies, etc).

Java+ handles this according to settings you pass it via the Ant, Make, and GUI interfaces. Each interface is described in a separate section of this document (see the links in the top margin).

Download Instructions

java+.tgz (73 kb) md5: fixme
The java+ distribution as a zipped tar file. This contains an executable jar (build/java+.jar) with the make, ant and gui interfaces. All three are Java code that will work on any platform that has Java installed (tested with Java 1.2 and 1.4 on MacOSX and Linux). All distributions contain documentation and source code.
java+.dmg (73 kb) md5: fixme
The java+ distribution as a Mac OSX .dmg file. This is an experimental repackaging of the same contents described above. (You'll have to right-click and choose "Save link as" or similar to download this. I'm still researching the proper mime type incatation to use for .dmg files).

Installation Instructions

Expanding java+.tgz (tar zxf java+.tgz) will create a directory named java+. Move it to its permanent location, which will be called the install directory in what follows. It has the following subdirectories:

Contains the binary jar (java+.jar) and documentation (html subdirectory).
This is a script for launching java+. Either add the java+ install directory to your search path or move to your search path and edit INSTALLPATH to identify the install directory. Ensure that the script is executable (chmod a+x java+ on Unix) and type java+ [-ant|-make|-gui] [options] to run it. If you only plan to use it, that is it, you're done here. Skip to the Syntax section for how to use it.

The rest of this section relates to building Java+, not using it. Ensure that recent releases of Junit, Ant and JWAA are installed, then modify the project definition files you plan to use with their install locations, Junit is needed for the Java+ test programs. Ant is needed for the Ant interface.

Java+ program (edu) and documentation (html) source files. The documentation in build/html is built by the Java programs in the html directory as described below.
Make (Makefile), Ant (build.xml), and Java+ GUI (, project files for building Java+ from source.

The Past

Java+ originated as the MLS preprocessor within the Java Web Application Architecture (JWAA). Both originated as spinoffs from the MyBank Digital Rights Management Project (MyBank).

The server side of this system was originally prototyped in Perl and ported to JSP in the first commercial release. This system has many web pages that are extensively crosslinked with hyperlinks. In Perl and JSP, hyperlinks are hardcoded in the html. This made refactoring excruciating since renaming or moving any page might break numerous other pages. Since web pages are the top-level objects from which this system is composed, we began to look for an approach that treated web pages as first class objects, not as modified html text, especially one that could check validity of cross-page (aka object) references. Java+ and JWAA were the results of that search.

Future Plans

The Java+ Project has so far focused entirely on Java's string syntax, but more radical enhancements are imaginable. Others on my personal wish list are:

That's it for the moment. The author welcomes feedback, which will shape developent priorities.

Java+ Version 2.0 © Copyright 2003 by Brad Cox 12 Dec 2003
Served by John Companies, Inc.