Communicator 3000 MPE/iX Release 6.0 (Platform Software Release C.60.00) (30216-90269)
Chapter 10 247
Technical Articles
Developer’s Kit for Java/iX
created at this level to hold that version of the binaries. The lib
hierarchy follows the same structure as the bin hierarchy, with
PA-RISC and green_threads subdirectories. One file residing at the
top level of the lib hierarchy, classes.zip, is an archive file that
contains all of the standard Java classes. You do not have to unzip it to
access this archive (in fact, you can access it faster as a single zip file
than as hundreds of individual disk files). At the bottom level of the
hierarchy are a number of specialized libraries that are dynamically
loaded when needed for certain Java tasks. For example, libnet.sl
contains the Java networking code, and libawt.sl contains code used
by the Abstract Windowing Toolkit.
The demo directory holds a number of demo programs.
The doc directory holds HTML format API documentation.
Using Java
Writing Java Programs
There are no unique tools on the HP 3000 for writing Java programs;
you just select your favorite word processor and enter the program text.
You can use either a traditional HP 3000 editor such as EDIT/3000 or
HP EDIT, or you can use the vi editor from within the POSIX shell.
The naming of a Java source file should follow the following
conventions:
• The name must be followed by the extension .java
• The name is case-sensitive. While not a requirement, it is
conventional to use mixed case in class names, with an initial capital
and additional capitals used if the class name contains more than
one word (for example, HelloWorld.java).
• Java files must be in bytestream format. VI will create bytestream
files for you. If you use another editor such as HPEDIT, you will need
to use the shell’s tobyte command to convert the source file to
bytestream format.
Because of these requirements, if you use an editor that does not
support full POSIX naming conventions, you must either use file
equations or rename your source file to meet the requirements.
If your program is part of a package, it needs to be placed in an HFS
directory whose name is the same as the package name.
For an example, consider the following, perhaps the simplest possible
Java program:
public class HelloWorld
{
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}