Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在 javac/java 类路径中添加多个 .jar 文件 - 对于 Debian Linux。
我在用,
javac -cp a.jar folder1\folder2\b.jar Test.java
但是,它给出了 Invalid flag 错误。谁能帮我编译和运行它?
用冒号分隔类路径条目:,而不是空格。
:
此外,您应该使用 '/' 而不是 '\' 作为目录分隔符。
使用 Powershell 时还要使用引号 " 来指定类路径:
javac -cp ".;folder1\folder2\b.jar" Test.java