TENCHIANG / blog

issue blog
10 stars 1 forks source link

JDK学习笔记 #76

Open TENCHIANG opened 4 years ago

TENCHIANG commented 4 years ago

CLASSPATH

Main.java


public class Main {

    public static void main (String[] args) {
        Console.writeLine("Hello");
    }
}

Console.java


public class Console {

    public static void writeLine (String string) {
        System.out.println(string);
    }
}
TENCHIANG commented 4 years ago

SOURCEPATH

# proj/src/ 下有 Main.java Console.java
# Main.java调用了Console.java
cd proj
javac -sourcepath src -d classes src/Main.java # classes下就有了两个class文件
java -cp classes Main

javac -verbose 查看编译详情