hpjava Command

This page describes the hpjava command and provides a complete description of the command syntax, options, and arguments. The hpjava command is similar to the JDK java command. Specifically, this page discusses the following topics:

Syntax

hpjava [run-time_options] classname [user_program_arguments]

hpjava
The command used to run Java bytecodes that have been compiled into DLLs using the HPCJ hpj command.
 
run-time_options
Standard and non-standard run-time options that you can specify with the hpjava command to control run-time activities. Non-standard options begin with an X and are subject to change. All command options begin with a dash (-) and must be separated from associated arguments by a space. A table containing a list of valid options is found below in the section entitled Options. A table containing a list of valid input files that you can specify as arguments is found below in the section entitled Input Files.
 
classname
The name of the class that you want to run using the hpjava command. The class name must be fully qualified by including its package in the name. For example:

hpjava java.lang.string

The hpjava command expects the compiled version of the class to be in a simple or compound DLL. The class name must contain a main method that is defined as follows:
 
class Aclass {
    public static void main(String argv[]) {
        ...
    }
}
The hpjava command runs the main method and then exits unless main() creates one or more threads. If any threads are created by main(), then hpjava does not exit until the last thread exits.
 
user_program_arguments
These are arguments required by your user program. Any arguments that appear on the command line after classname are passed to the main() method of the specified class.

Options
The following table lists the options and associated arguments that you can specify with the hpjava command.

Options Description Default
-classpath path Specifies the path hpjava uses to look up classes. Overrides the default or the CLASSPATH environment variable (if it is set). Information about the classpath is found in the topic Loading Classes with the Classpath Setting.

The general format for path is:

.: your_path
.; your_path

For example:

.:/home/xyz/classes: /usr/local/java/classes.jll
(Each specifier must be separated by a colon (:) character.)

.;\home\xyz\classes; e:\java\classes.jll
(Each specifier must be separated by a semi-colon (;) character.)

-classpath
-Dname=value Redefine a property value (where name is the name of the property whose value you want to redefine, and value is the new value that you want to assign to the property). For example, the following command sets the value of the property awt.button.color to green:

hpjava -Dawt.button.color=green

The hpjava command accepts any number of -D options on the command line.
 
-help or -? Display usage information if no other options are specified on the command line.  
-load DLL_files Specify a list of simple or compound DLL (.jlc or .jll) files to initially load. The -load option directs the VM to explicitly load the specified .jlc or .jll files. In the case where this option is specified more than once, only the last specifier is honored. The DLL_files argument is a list of platform-specific file specifiers. The VM immediately terminates if any one of the DLLs specified on DLL_files cannot be located.

The specifiers are separated by a colon (:) character.

The specifiers are separated by a semi-colon (;) character.

 
-v[:class] Causes hpjava to print a message to stdout each time a DLL is loaded.  
-version Display the build version information.  
-X Display help for non-standard options that are subject to change. This is a non-standard option that is subject to change.  
-Xfastmath Use faster math library routines. This is a non-standard option that is subject to change.  
-Xss size Set a maximum native stack size for any thread. Every thread that is spawned during the execution of the program passed to hpjava has size as its stack size. The default unit for size is bytes. You can modify the value of size by appending the letter K to size to specify kilobytes or by appending the letter M to specify megabytes. This is a non-standard option that is subject to change.  

 


Java Executables and DLLs


Loading Classes with the Classpath Setting
Building Executables and DLLs