JVM Programming
DESCRIPTION
Java programs are compiled into bytecode which is independent of the
underlying computer architecture. The resulting compiled classes can run
on any Java virtual machine (JVM). The JANOS JVM is a 'clean-room'
implementation developed entirely from 'The Java(tm) Virtual Machine
Specification' written by Tim Lindholm and Frank Yellin published by
Addison Wesley Longman, Inc. Copyright (c) 1997 Sun Microsystems, Inc.
Each application program is executed by its own instance of JVM. Each
appears as a separate process. Each program may have any number of
independently running threads. As JANOS can execute as many as 16 separate
processes and understanding that several processes need be reserved for
network and system activity, JANOS can reliably run several instances of
the JVM getting the job done for you.
RUNTIME
Java is a class-based, object-oriented programming language. The
java.lang.Object is the root of the entire Java class hierarchy. Every
class has Object as a superclass. The /etc/JanosClasses.jar file located
on every JNIOR in read-only memory contains the necessary java. class
library as well as additional libraries as are necessary for programs to
interface to JNIOR hardware and the rest of the world.
To be successful, application programs developed for JNIOR must be built
entirely on JanosClasses.jar and not with respect to any libraries that
might otherwise be installed in combination with the IDE and compiler you
use. The JanosClasses.jar file may be uploaded from the JNIOR and
specified in the -bootclasspath option to the compiler. A program built
in this way is guaranteed to have everything it needs to run reliably
without Exception on any JNIOR.
The JanosRuntime_2.0.jar runtime library file can separately be obtained
from the INTEG website at
jnior.com . This file contains
the same class libraries that are available in JanosClasses.jar, additionally
including Javadoc and source code detail to support development using an IDE.
While either file will generate the same program the latter is invaluable in
getting the most out of your IDE and JNIOR.
CLASS FILES
Custom class files as required by an application should be included in the
program's JAR file. The class files associated with the Java runtime are
available through the /etc/JanosClasses.jar file supplied by the operating
system.
If an additional library of class files is to be used, their location, or
locations, can be specified by the CLASSPATH environment variable. This
CLASSPATH environment setting defines one or more JAR files separated by
a semicolon ';'. Absolute file specifications (from the file system root)
must be used. This lists JAR files and not just paths. A ZIP file library
can also be used.
When the Java ClassLoader locates a class file (.class extension) it uses
the following search path and attempts to obtain the file:
1. from the file system (e.g. /java/lang/Object.class)
2. from the application program JAR
3. from each JAR/ZIP referenced in CLASSPATH (left to right)
4. from /JanosClasses.jar
5. from /flash/JanosClasses.jar
6. from /etc/JanosClasses.jar (default supplied by JANOS)
Generally classes are located either in the program JAR (2) or in the
default JanosClasses Runtime (6). The other locations are searched and they
optionally provide a means to override one or more classes in the
default runtime. This can be useful in debugging or in deploying updated
applications in advance of an operating system release.
NOTES
Programs access JNIOR hardware and other capabilities using a low-level
native interface. A optimized call-by-name method is used permitting the
operating system to be freely updated without creating a need to recompile
application programs. Once a built-in method is located its location is
cached and programs execute fast and efficiently.
SEE ALSO
HELP Topics:
COMPILING,
PROGRAMMING,
JanosClasses.jar
[/flash/manpages/program.hlp:22]