非常简单的问题。不使用Ants或Maven可以完成吗? (我特指的是命令行工具)
请注意,我不想创建 uberjar,我只是希望存档单元“知道”其外部依赖项在哪里。
假设您正在谈论命令行调用javac
,您所说的是“我可以提供库作为 javac 的参数来满足编译期间的要求”。
顶部条目man javac
says
-classpath classpath
Sets the user class path, overriding the user class path in the
CLASSPATH environment variable. If neither CLASSPATH or -class-
path is specified, the user class path consists of the current
directory. See Setting the Class Path for more details.
实际上我怀疑你只需要说
javac -classpath path/to/library1.jar Main.java
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)