Contents | Prev | Next | Index


Environment Variables

Canterbury Oberon-2 for Java uses the following Java System properties for its environment:

path.separator
A special character which is being used in the java.class.path property for separating its directory list and/or zip-file list entries. On Win32 or OS/2 systems it is the semicolon character ";". On UNIX systems it is the colon character ":"
file.separator
A special character which is being used in the java.class.path property for separating the components of directory names. On Win32 or OS/2 systems it is the character "\". On UNIX systems it is the character "/".
user.dir
This is the users current working directory, usually the one from where he launches the compiler.
java.class.path
A list directory or zip-file name entries, separated by the path.separator character. When Java looks for a class file, it goes through this list for finding it. If the requested class file is in a package, e.g. "java.awt.event", it looks for the class file in a nested directory, e.g. "java\awt\event\<classfile>", nested as a whole in one of the directory or zip-file entries of the java.class.path property list.

This is where Canterbury Oberon-2 looks for source files:

It first looks for the source file in the current working directory according to the user.dir property. If it is not there, the compiler looks for it in the compiler home directory "mhc\runtime\obn" (or "mhc/runtime/obn"), which in turn resides in the installation directory. If it is not there either, the compiler goes through the whole java.class.path list in order to locate the source file.

Finally, this is where Canterbury Oberon-2 for Java writes its Java output files:

If the compiled Oberon-2 source file contains no JAVA PACKAGE directive, the output goes into the current working directory according to the user.dir property. If the source contains a JAVA PACKAGE directive, it translate its package identifier into a corresponding directory name (e.g. "mystuff.samples" would become "mystuff\samples" or "mystuff/samples" depending on operating and file system being used). It then goes through the whole list of directory entries according to the java.class.path property in an attempt to locate this subdirectory, and it is there where the compiler output then goes. If the compiler can't find the subdirectory it stops with an error message.

Notice that on some systems, e.g. OS/2 HPFS or Windows-95 FAT, files are located by using a case insensitive name search even though file names themselves are stored with correct cases. Thus, while Oberon-2 (as well as Java) makes a distinction between e.g. "myStuff" and "mystuff" because of being case sensitive, this might not necessarily be the case with some file systems. Hence, to be on the safe side, when using type names for RECORD types (which are mapped to Java classes and will eventually end up as class files) there should be also a case insensitive name distinction for these names.


Contents | Prev | Next | Index

Canterbury Oberon-2 for Java  (Last documentation update Feb 8, 2000)
Copyright © 1998 Mill Hill & Canterbury Corporation, Ltd. All rights reserved
Please send any comments or corrections to mhc@webcom.com