Copyright, Stephan Diehl, 2000-2003

Java Old-Style Shell

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.jar
If you use Java version 1.2, you should download the ZIP-distribution file, unpack it and customize the batch files and the file manually.
If you encounter any problems after installation: Check the file to adjust class paths and the execution path of the programs "java" and "javac" of the JDK1.2 or higher. If you use Windows you might also have to change the file josh.bat. Change the path in the line "set JOSHDIR=..." to the path where you installed JOSH.

How to start JOSH

Windows and Unix:

   josh example.josh
On UNIX platforms the following also works:
   josh < example.josh
And as JOSH thus reads and interpretes files, it can be used as a shell in shell-scripts:
   System.out.println("The most expensive ECHO");


All commands of JOSH start with a dollar sign '$' at the beginning of the line. All other input is interpreted by JOSH as a Java expression, declaration or statement. $help prints a summary of all commands of JOSH:
  $compile     Compile file named ''
  $edit                  Interprete input created with external editor
  $josh file.josh        Interprete file named 'file.josh'
  $edit        Edit file named '' in external editor
  $execute classname     Execute class
  $exit                  Exit interpreter
  $quit                  Exit interpreter

An Example Session

To see an example session start JOSH with the file example.josh:
  josh example.josh

Known Restrictions of JOSH: