Name javap---The Java Class Disassembler Availability JDK 1.0 and later. Synopsis
javap [ options ] classnames
Description javap disassembles the class files specified by the class names on the command line and prints a human-readable version of those classes. By default, javap prints declarations of the non-private members of each of the classes specified on the command line. The -l, -p, and -c options specify additional information to be printed, including a complete disassembly of the byte-codes in each of the specified classes. javap can also be used to run the class verifier on Java classes. Options
Print the Java Virtual Machine instructions for each of the methods in each of the specified classes. This option disassembles all methods, including private methods.
The path that javap uses to look up the classes named on the command line. This option overrides the default path and any path specified by the CLASSPATH environment variable. The path specified is an ordered list of directories and ZIP files, separated by colons on UNIX systems or semicolons on Windows systems. To specify additional directories or ZIP files for javap to search without overriding the default system class path, use the CLASSPATH environment variable. See the java reference page for more information on specifying paths.
Outputs the class in a form suitable for inclusion in a C header file.
When a path is specified with this environment variable.
. If this environment variable is not specified.
Prints private methods and variables of the specified class in addition to the public ones. the default path is the current directory and the system classes. Note that line numbers and local variable information is included for use with debuggers. javap always implicitly appends the location of the system classes to the end of the path. This variable is overridden by the -classpath option. semicolon-separated on Windows systems) of directories and ZIP files in which javap should look for class definitions.
Causes javap to display its version number. Outputs additional information (in the form of Java comments) about each member of each specified class.
Causes javap to run the class verifier on the specified classes and display the results of verification. Environment
Specifies an ordered list (colon-separated on UNIX. line number information is available only if a class was compiled without the -O option.-l
Prints line numbers and local variable tables in addition to the public fields of the class.
Verbose. Note that some compilers (though not javac) may allow this private field information to be "obfuscated" in such a way that private fields and method arguments no longer have meaningful names. This makes Java classes harder to disassemble or reverse engineer.
Outputs the class member declarations using the internal Virtual Machine format. Local variable information is available only if a class was compiled with the -g option to javac.
javac may be passed any number of Java source files. if the source file for that class is newer than the class file).class files).e. You may specify additional classes and packages to be searched with the -classpath option or the CLASSPATH environment variable.java files) into Java bytecodes (in . and that the name of the file (minus the . In other words. whose names must all end with the . without overriding the default system class path. separated by colons on UNIX systems or semicolons on Windows systems. See the java reference page for more information on specifying paths.. This option overrides the default path and any path specified by the CLASSPATH environment variable. Note also that the compiler requires that there be only a single public class defined in any one source file.
. there need not be a one-to-one mapping between Java source files and Java class files.class class file for each class defined in the source files. Synopsis
javac [ options ] files
Description javac is the Java compiler--it compiles Java source code (in . By default. of course). The default class path contains only the current directory and the system classes. javac places the class files it generates in the same directory as the corresponding source file. The path specified is an ordered list of directories and ZIP files. use the CLASSPATH environment variable.0 and later. javac produces a separate . Options
The path that javac uses to look up classes referenced in the specified source code. If javac compiles a source file that relies on a class that is out of date (i. javac searches for the definition of that class using the class path. You can override this behavior with the -d option. When a source file references a class that is not defined in another source file on the command line.javac---The Java Compiler Availability JDK 1. The Java compiler is itself written in Java. it automatically recompiles that file.java extension) be the same as the name of the class (minus its package name. To specify additional directories or ZIP files to be searched. regardless of how many source files there are.java extension.
Tells javac to issue a warning for every use of a deprecated API.1 and later. the following command:
% javac -d java/classes java/src/Checkers.
Tells javac to recompile any out-of-date class files it encounters.java file that those classes were defined in. By default. javac automatically creates any directories it needs to store its class files in the appropriate place. With the -O option.class files are placed in this directory. the specified directory is treated as the root of the class hierarchy and . Thus.java file has no package statement. if the source file specifies that it is in a package:
package david.class in the directory java/classes if the Checkers. for use by debuggers. use multiple -J options.
This option tells javac to add line numbers and local variable information to the output class files.
Tells javac not to print warning messages. Available in JDK 1.1 and later.-d
directory The directory in which (or beneath which) class files should be stored.
Pass the argument javaoption directly through to the Java interpreter. On the other hand. not just those that are referenced from one of the specified source files. javaoption should not contain spaces.games. however. javac does not generate even that information.class file is stored in java/classes/david/games.class files it generates in the same directory as the .
. javac only generates the line numbers. javac issues only a single warning if a program uses deprecated APIs. Errors are still reported as usual. if multiple arguments must be passed to the interpreter. By default. When the -d option is specified. depending on the package name of the class. or in the appropriate subdirectory below it.
then the . By default. javac stores the . If the -d flag is specified. Available in JDK 1.java
places the file Checkers.
Source files are parsed as usual. This variable is overridden by the -classpath option. This option is useful when you want to check that a file will compile without actually compiling it. and private methods inline. When a path is specified with this environment variable. Environment
Specifies an ordered list (colon-separated on UNIX.
Enable optimization of class files. but not the . but no output is written.Tells javac not to create any class files. Synopsis
java [ interpreter options ] classname [ program arguments ] java_g [ interpreter options ] classname [ program arguments ]
Description java is the Java byte-code interpreter--it runs Java programs.
Name java---The Java Interpreter Availability JDK 1. so that they execute faster. This option also prevents javac from adding line number debugging information to the class files. The trade-off is that the class files will be larger. This option may cause javac to compile static.0 and later. java_g is a debugging version of the interpreter. it must include the package name of the class. semicolon-separated on Windows systems) of directories and ZIP files in which javac should look for class definitions.
Tells the compiler to display messages about what it is doing. The program to be run is the class specified by classname. If this environment variable is not specified. This must be a fully qualified name. final. and has some additional options for tracing the execution of a program. It is unoptimized. the default path is the current directory and the system classes.class file
. javac always implicitly appends the location of the system classes to the end of the path.
On UNIX systems. and -verifyremote options control the byte-code verification process. that it does not corrupt the internal operand stack and that it performs appropriate run-time checks on such things as array references. Although only a single class name is specified when invoking java. For example. and the class name is specified alone. the interpreter automatically loads any additional classes required by the program. for example. described under the -classpath option below. This verifier performs a number of tests on the byte-code of the loaded class to ensure. By default. Note that you specify the package and class name. java runs until the last thread exits.games. -noverify. On Windows systems. the interpreter executes the body of main() and exits. which has its components separated by '/' or '/'. The class path is an ordered list of directories and ZIP files within and below which java searches for named classes. Otherwise. These classes are located relative to the Java class path. a UNIX -classpath specification might look like this:
-classpath /usr/lib/java/classes:.extension.'. If main() creates any threads. If a Java class has no package statement. with components separated by '. a path is specified as a colon-separated list of directories and ZIP files. the specification might be:
.Checkers % java test
See the description of the -classpath option and the CLASSPATH environment variable below for information on specifying where java should look for classes. The class specified by classname must contain a method main() with exactly the following signature:
public static void main(String argv)
Any arguments following the classname on the java command line are placed into an array and passed to the main() method when java starts up. java runs a byte-code verifier on all classes loaded over the network. The -verify.:~/java/classes
On a Windows system. not the directory and filename of the class. then it is not in any package. Options
The path that java uses to look up the specified classname and all other classes that it loads. Specifying this option overrides the default path and the CLASSPATH environment variable. Examples:
% java david. directories and ZIP files (which may have drive specifiers that use colons) are separated from each other with semicolons.
class beneath one of the directories specified in the class path. java_g only. Directories and ZIP files are searched in the order they appear. Java would load the class java. For example:
% java -Dawt.
Print a usage message and exit.$JAVA\lib\classes. -checksource
Both of these options tell java to check the modification times on the specified class file and its corresponding source file.zip .$JAVA\classes. on a UNIX system.
Sets the logging level for trace output. it is automatically recompiled from the source. Place the standard Java classes first in the path if you do not want them to be accidentally or maliciously overridden by classes with the same name in other directories. Thus.class beneath a specified directory or within a specified ZIP file.zip.color=gray -Dmy.class -debug
Causes java to display a password as it starts up. Your Java program can then look up the specified value by its property name. Similarly.
Defines propertyname to equal value in the system properties list. on a Windows 95 or Windows NT system (which support long filenames).zip UNIX systems Windows systems
Where $JAVA is JDK installation directory.pointsize=14 my. If the class file cannot be found or if it is out of date.
. This password can be used to allow the jdb debugger to attach itself to this interpreter session. You may specify any number of -D options.String by looking for the file java/lang/String. the default class path is:
.:$JAVA/classes:$JAVA/lib/classes.button.. Note that this password should not be considered cryptographically secure.class.lang.-classpath C:\tools\java\classes. java expects to find class files in a directory hierarchy (or with a directory name within a ZIP file) that maps to the fully qualified name of the class. java would look for the file java\lang\String.D:\users\david\classes
A period by itself in the path indicates that the current working directory is searched. If you do not specify -classpath or the CLASSPATH environment variable.
low-priority thread. The format of this profiling information is not well documented. You can specify it in kilobytes by appending the letter k or in megabytes by appending the letter m.prof in the current directory. Prior to JDK 1.
maxmem[k|m] Specifies the maximum heap size the interpreter will use for dynamically allocated objects and arrays. no file can be specified.prof. The default is 1 MB. The default is 16 MB. For large or memory intensive applications (such as the Java compiler).
Output profiling information to the specified file or to the file java.
Do not garbage collect loaded classes that are no longer in use. You can specify maxmem in kilobytes by appending the letter k and in megabytes by appending the letter m. You must specify an initial heap size of at least 1000 bytes. You can specify it in kilobytes by appending the letter k or in megabytes by appending the letter m. By default. java only performs garbage collection when it runs out of memory or when the garbage collector is explicitly invoked./java. stacksize is specified in bytes. profiling information is always output to . you can improve run-time performance by starting the interpreter with a larger amount of memory. java runs the garbage collector as a separate.-ms
initmem[k|m] Specifies how much memory is allocated for the heap when the interpreter starts up. This option is only available in JDK 1.1 and later. The default value is 400 KB.
Do not do garbage collection asynchronously. You must specify at least 1000 bytes. You must not specify a heap size less than 1000 bytes.
stacksize[k|m] Sets the size of each thread's Java code stack.
Never run the byte-code verifier. With this option specified. By default. Without this option. initmem is specified in bytes.1. maxmem is specified in bytes by default.
This variable is overridden by the -classpath option.) This is the default behavior for java. stacksize is specified in bytes.
Run the byte-code verifier on all classes that are loaded through a class loader.
Run the byte-code verifier on all classes that are loaded. When a path is specified with this environment variable.Sets the size of each thread's native code stack. If this environment variable is not specified.
Print the version of the Java interpreter and exit.
Print a message whenever the garbage collector frees memory. java_g only. java_g only.
-v. The default value is 128 KB. By default. Environment
Specifies an ordered list (colon-separated on UNIX. (This generally means classes that are dynamically loaded from an untrusted location. You can specify it in kilobytes by appending the letter k or in megabytes by appending the letter m. the default path is the current directory and the system classes.
Output a trace of all bytecodes executed.
Output a trace of all methods executed. See -classpath above for more information on specifying paths. semicolon-separated on Windows systems) of directories and ZIP files in which java should look for class definitions. -verbose
Print a terminal message each time java loads a class. java always implicitly appends the location of the system classes to the end of the path.
. You must specify at least 1000 bytes.