2020-10-09 16:19:37 +01:00
|
|
|
# javac
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
> Java 程序编译器。
|
2021-09-16 19:50:00 +01:00
|
|
|
> 更多信息:<https://docs.oracle.com/en/java/javase/17/docs/specs/man/javac.html>.
|
2020-10-09 16:19:37 +01:00
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
- 编译一个 `.java` 文件:
|
2020-10-09 16:19:37 +01:00
|
|
|
|
|
|
|
`javac {{文件名.java}}`
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
- 编译多个 `.java` 文件:
|
2020-10-09 16:19:37 +01:00
|
|
|
|
|
|
|
`javac {{文件名1.java}} {{文件名2.java}} {{文件名3.java}}`
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
- 编译当前目录内所有 `.java` 文件:
|
2020-10-09 16:19:37 +01:00
|
|
|
|
|
|
|
`javac {{*.java}}`
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
- 编译一个 `.java` 文件并将生成的 class 字节码文件放入一个指定目录:
|
2020-10-09 16:19:37 +01:00
|
|
|
|
2022-09-18 22:56:13 +01:00
|
|
|
`javac -d {{路径/到/目录}} {{文件名.java}}`
|