javac编译命令

https://docs.oracle.com/en/java/javase/17/docs/specs/man/javac.html#standard-options

Precompiled Code

The code to be compiled may refer to libraries beyond what is provided by the platform. If so, you must place these libraries on the class path or module path. If the library code is not in a module, place it on the class path; if it is in a module, place it on the module path.

  • Use the --class-path option to specify libraries to be placed on the class path. Locations on the class path should be organized in a package hierarchy. You can also use alternate forms of the option: -classpath or -cp.

  • Use the --module-path option to specify libraries to be placed on the module path. Locations on the module path should either be modules or directories of modules. You can also use an alternate form of the option: -p.

    See Configuring the Module System for details on how to modify the default configuration of library modules.

Note: the options for the class path and module path are not mutually exclusive, although it is not common to specify the class path when compiling code for one or more modules.

posted @ 2025-04-05 20:04  MikeLi  阅读(15)  评论(0)    收藏  举报