简体   繁体   English

Netbeans找不到外部jar

[英]Netbeans can't find external jar

I'm fairly new to Java and need to add an external Jar to the project in netbeans. 我对Java还是很陌生,需要在netbeans中向该项目添加一个外部Jar。 I've created a library with that Jar using Tools --> Libraries, and added the library in the project Properties --> Libraries under compile, but it still returns "Package does not exist". 我已经使用工具->库用该Jar创建了一个库,并在编译下的项目属性->库中添加了该库,但它仍返回“包不存在”。

Any help? 有什么帮助吗?

Perhaps the library was created incorrectly. 可能是库创建不正确。 If the package structure in the JAR isn't correct, the class loader won't be able to find the .class file. 如果JAR中的包结构不正确,则类加载器将无法找到.class文件。

Open the JAR with WinZip and confirm the contents. 使用WinZip打开JAR并确认内容。

What version of Netbeans are you using? 您正在使用哪个版本的Netbeans? Make sure your libraries are located outside of the project directory. 确保您的库位于项目目录之外。 Just making sure when you add the jar, you don't just add the folder containing them but the actual jar -right? 只要确保在添加jar时,就不只是添加包含它们的文件夹,而是实际的jar-对吗?
Try building the project to see if that helps. 尝试构建项目以查看是否有帮助。

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

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