我在 java 文件 (MyRtmpClient.java) 中有以下内容:
I have the following in a java file (MyRtmpClient.java):
import org.apache.mina.common.ByteBuffer;
和 ByteBuffer 位于 JAR 文件中(当然具有正确的目录结构).该 jar 文件和我需要的其他文件与 .java 文件位于同一目录中.
and ByteBuffer is inside a JAR file (with the proper directory structure of course).
That jar file and others I need are in the same directory as the .java file.
然后我用这一行编译:
javac -cp ".;*.jar" MyRtmpClient.java
但我得到了错误:
MyRtmpClient.java:3: 包 org.apache.mina.common 不存在
导入 org.apache.mina.common.ByteBuffer;
如何在我的项目中包含 jar 文件?
How can I include jar files in my project?
你的命令行是正确的,但是有一些注意事项:
your command line is correct, but there are some considerations:
我假设 JAR 文件具有您所说的正确目录结构.
I'm assuming that the JAR file has the proper directory structure as you stated.
这篇关于编译时如何通配符包含 JAR 文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
如何检测 32 位 int 上的整数溢出?How can I detect integer overflow on 32 bits int?(如何检测 32 位 int 上的整数溢出?)
return 语句之前的局部变量,这有关系吗?Local variables before return statements, does it matter?(return 语句之前的局部变量,这有关系吗?)
如何将整数转换为整数?How to convert Integer to int?(如何将整数转换为整数?)
如何在给定范围内创建一个随机打乱数字的 intHow do I create an int array with randomly shuffled numbers in a given range(如何在给定范围内创建一个随机打乱数字的 int 数组)
java的行为不一致==Inconsistent behavior on java#39;s ==(java的行为不一致==)
为什么 Java 能够将 0xff000000 存储为 int?Why is Java able to store 0xff000000 as an int?(为什么 Java 能够将 0xff000000 存储为 int?)