javac 和 java

来源:互联网 发布:淘宝刷单泄露个人信息 编辑:程序博客网 时间:2024/05/16 08:28

########################  javac

##code

import java.util.Date;

public class HelloWorld{
public static void main(String args[]){
System.out.println("Hello World!");


}

}

##javac

D:\> javac -verbose HelloWorld.java
[parsing started HelloWorld.java]
[parsing completed 16ms]
[loading C:\Program Files\Java\j2sdk1.4.2_15\jre\lib\rt.jar(java/util/Date.class)]
[loading C:\Program Files\Java\j2sdk1.4.2_15\jre\lib\rt.jar(java/lang/Object.class)]
[loading C:\Program Files\Java\j2sdk1.4.2_15\jre\lib\rt.jar(java/lang/String.class)]
[checking HelloWorld]
[loading C:\Program Files\Java\j2sdk1.4.2_15\jre\lib\rt.jar(java/lang/System.class)]
[loading C:\Program Files\Java\j2sdk1.4.2_15\jre\lib\rt.jar(java/io/PrintStream.class)]
[loading C:\Program Files\Java\j2sdk1.4.2_15\jre\lib\rt.jar(java/io/FilterOutputStream.class)]
[loading C:\Program Files\Java\j2sdk1.4.2_15\jre\lib\rt.jar(java/io/OutputStream.class)]
[wrote HelloWorld.class]
[total 874ms]
D:\>

##

"Single type import" statements load classes immediately.
"javac" searches for definitions of new types first in the loaded classes, then in the source path, and finally in the packages specified in the "On-demand type import" statements.

“-verbose”生成详细的编译信息。


########################  java

"java" is the standard application launcher in JDK.
"-sourcepath" specifies places where to search for class definitions of new types.
"-jar" specifies a JAR file and launches the class specified in the manifest file.
"javaw" is identical to "java" except that it will not create the console window.

-D to set a system property

-verbose to set verbose output

-Xms  -Xmx  -Xbootclasspath/p:


原创粉丝点击