HP-UX HB v13.00 Ch-11 - Software Development

HP-UX Handbook Rev 13.00 Page 42 (of 101)
Chapter 11 Software Development
October 29, 2013
Executing
A java application must contain one class that provides a method (function) defined exactly as
public static void main(String[] args), which is invoked to start the application. To
execute a java program, the JVM must be started with the class or jar archive that contains this
method as a command line parameter:
java HelloWorld
java -jar HelloWorld.jar
Note that the .class extension of the class file must be omitted, while the .jar extension is
required. If the java application is provided as a jar archive, the JVM is able to open it and pick
the class files from the archive when methods of these classes are called.
The JVM is responsible for interpreting the bytecode, but running in interpreted mode is
extremely slow. To increase the performance of java applications, the JVM has a built-in native
compiler (called hotspot compiler) which translates the bytecode from the class files into native
machine code while the application is running. Once a method has been compiled, the JVM will
call the compiled version instead of interpreting the bytecode again.
Products
Java comes either as a software development kit (JDK, SDK) or a runtime environment (JRE,
RTE). The JDK includes the JRE. If a JDK is installed, there is no need to also install the JRE.
At the time of this writing HP supports 3 major java releases:
Major Version
Installation Path
Java 2 Version 1.4
/opt/java1.4
Java 2 Version 1.5
/opt/java1.5
Java 2 Version 6
/opt/java6
These major releases are located in different directories, thus can be installed in parallel.
There are different subrelease lines for Java 1.4:
1.4.0, 1.4.1, 1.4.2
Versions 1.4.0 and 1.4.1 are obsolete. Customers should upgrade to the latest 1.4.2 version.
Since version 1.4, all HP JVMs contain a 32-bit as well as a 64-bit JVM. To invoke the 64-bit
JVM, the java command line option -d64 must be used.