2015-12-29 02:11:07 +00:00
|
|
|
# javac
|
|
|
|
|
2022-10-11 03:59:50 +01:00
|
|
|
> Java application compiler.
|
2023-06-04 02:48:54 +01:00
|
|
|
> More information: <https://docs.oracle.com/en/java/javase/20/docs/specs/man/javac.html>.
|
2015-12-29 02:11:07 +00:00
|
|
|
|
2021-01-31 17:05:18 +00:00
|
|
|
- Compile a `.java` file:
|
2015-12-29 02:11:07 +00:00
|
|
|
|
2023-12-27 06:41:30 +00:00
|
|
|
`javac {{path/to/file.java}}`
|
2016-01-15 05:51:53 +00:00
|
|
|
|
2021-01-31 17:05:18 +00:00
|
|
|
- Compile several `.java` files:
|
2016-01-15 05:51:53 +00:00
|
|
|
|
2023-12-27 06:41:30 +00:00
|
|
|
`javac {{path/to/file1.java}} {{path/to/file2.java}} {{path/to/file3.java}}`
|
2016-01-15 05:51:53 +00:00
|
|
|
|
2021-01-31 17:05:18 +00:00
|
|
|
- Compile all `.java` files in current directory:
|
2016-01-15 05:51:53 +00:00
|
|
|
|
|
|
|
`javac {{*.java}}`
|
|
|
|
|
2021-01-31 17:05:18 +00:00
|
|
|
- Compile a `.java` file and place the resulting class file in a specific directory:
|
2016-01-15 05:51:53 +00:00
|
|
|
|
2023-12-27 06:41:30 +00:00
|
|
|
`javac -d {{path/to/directory}} {{path/to/file.java}}`
|