简体   繁体   English

如何使用 javac 编译 txt 文件中的 .java 文件?

[英]How to ues javac to compile .java files wrote in a txt file?

I have some .java file, like a.java, b.java, c.java...., is there a way to compile them together by writting .java files' name into a txt file, and use some javac opitions to compile them?我有一些 .java 文件,如 a.java、b.java、c.java....,有没有办法通过将 .java 文件的名称写入 txt 文件来将它们编译在一起,并使用一些 javac 选项来编译它们? Like "javac (some options here) a.txt".像“javac(这里有一些选项)a.txt”。 The txt file contains the name of .java file that I want to compile. txt 文件包含我要编译的 .java 文件的名称。

将用空格或换行符分隔的 java 文件路径写入file.txt并使用@调用javac前置file.txt

javac @file.txt

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM