-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathjava.1
65 lines (65 loc) · 1.41 KB
/
java.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
.TH JAVA 1
.SH NAME
java \- launch a java application
.SH SYNOPSIS
.B java
.RB [ \-cp
.IR pathlist ]
.I classname
.RI [ args ...]
.SH DESCRIPTION
.B java
starts a Java application.
It does this by starting the Java Runtime Environment,
loading the specified class, and calling that class's
.B main()
method.
The method must be declared
.I public
and
.IR static ,
it must not return any value, and it must accept a
.B String
array as a parameter.
The method declaration has the following form:
.IP
.EX
public static void main(String[] args);
.EE
.PP
The JRE searches for the startup class (and other classes used by the application)
in the class path.
The class path is, by default, the current working directory.
The class path can be specified by the environment variable
.B CLASSPATH ,
or by the the command line option
.B -cp
(the command line option overrides the environment variable).
.PP
The options are as follows:
.TP
.BI "\-cp " pathlist
Specify a colon-delimited list of directories as the class path.
.SH ENVIRONMENT
The following environment variables affect the execution of
.B java
.TP
.B CLASSPATH
Colon-delimited list of directories as the class path.
.SH EXIT STATUS
.TP
.B 0
Success.
.TP
.B >0
Error occurred.
.EE
.SH SEE ALSO
.IR javac (1),
.IR javap (1)
.PP
Tim Lindholm, Frank Yellin, Gilad Bracha, Alex Buckley,
.I The Java® Virtual Machine Specification: Java SE 8Edition,
Addison-Wesley,
2014.
ISBN 978-0-13-390590-8.