1,安装jdk;2,配置环境变量;3,新建D:/Test.java文件;4,文件内容如下:public class Test{ public static void main(String[] args){ System.out.println("Hello World."); }}5,打开命令行,录入:cmd6,cd d:7,javac Test.java8,java Test命令行窗口打印结果:Hello World.程序结束.