2015-12-29 02:11:07 +00:00
|
|
|
# javac
|
|
|
|
|
2022-10-11 03:59:50 +01:00
|
|
|
> Java application compiler.
|
2022-10-30 22:40:02 +00:00
|
|
|
> More information: <https://docs.oracle.com/en/java/javase/19/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
|
|
|
|
2018-01-28 11:09:13 +00:00
|
|
|
`javac {{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
|
|
|
|
2018-01-28 11:09:13 +00:00
|
|
|
`javac {{file1.java}} {{file2.java}} {{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
|
|
|
|
2022-09-18 22:56:13 +01:00
|
|
|
`javac -d {{path/to/directory}} {{file.java}}`
|