JOSH is a Java interpreter. It was designed to ease teaching Java to beginners. We believe that they should learn basic programming concepts, before they are exposed to classes and objects.
With JOSH beginners can interactively evaluate simple expressions, execute program statements and define variables (fields) and functions (methods). After they are familiar with these concepts they can define new classes.
Since JOSH is implemented as a front end to the Java compiler, it accepts (almost) the full Java syntax. As a result, we do not have to explain the syntax here. Instead we explain the commands of JOSH and provide an annotated example session which demonstrates the features of JOSH.
JOSH requires Java version 1.2 and higher. If you use Java version 1.3
and higher you should use the installation file to install JOSH. Download
the installation file and run
java -jar joshinstall.jarIf you use Java version 1.2, you should download the ZIP-distribution file, unpack it and customize the batch files and the file josh.properties manually.
josh josh example.joshOn UNIX platforms the following also works:
josh < example.joshAnd as JOSH thus reads and interpretes files, it can be used as a shell in shell-scripts:
%/bin/josh System.out.println("The most expensive ECHO");
$compile file.java Compile file named 'file.java' $edit Interprete input created with external editor $josh file.josh Interprete file named 'file.josh' $edit file.java Edit file named 'file.java' in external editor $execute classname Execute class $exit Exit interpreter $quit Exit interpreter
josh example.josh