将 .JAR 添加到类路径时出现无效标志
总的来说,我对 Java 还很陌生,但我似乎不知道如何将 .JAR 添加到我的类路径中。
这是导致问题的我的 javac 行。
javac -d %PRAC_BIN% -sourcepath %PRAC_SRC% -cp %PRAC_BIN% %PRAC_LIB%\* %PRAC_SRC%\*.java
P03.jar 内部是一个 acsse.csc2a 包,其中包含三个 .java 文件及其各自的 .class 文件。
当我运行 .bat 文件时,我收到错误:无效标志:..\lib\P03.jar
。我该如何解决这个问题?
I'm still very new to Java as a whole, but I can't seem to figure out how to add a .JAR to my class path.
Here is my javac line thats causing the issue.
javac -d %PRAC_BIN% -sourcepath %PRAC_SRC% -cp %PRAC_BIN% %PRAC_LIB%\* %PRAC_SRC%\*.java
Inside P03.jar is a the package acsse.csc2a containing three .java files with their respective .class files.
When I run the .bat file, I receive error: invalid flag: ..\lib\P03.jar
. How do I fix this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当类路径有一个或多个目录时,它们应该用 Windows 平台特定的类路径分隔符分隔;和linux:
更改
为
应该可以
when classpath has one or more directories , they should separated by platform specific classpath separator char for windows ; and linux :
changing
to
should work