如何在netbeans项目中导入zip文件
当我尝试在我的 netbeans 项目中导入 zip 文件时,我在这一行中收到错误import jericho-html-3.1.src.java.net.htmlparser.jericho.*;
即使我添加了 zip 文件 Libraries 文件夹。
when I was trying import a zip file in my netbeans project, I get a error in this lineimport jericho-html-3.1.src.java.net.htmlparser.jericho.*;
even though I added the zip file Libraries folder.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可能想将库添加到项目中,以便可以在代码中调用它。
从行
import jericho-html-3.1.src.java.net.htmlparser.jericho.*;
我假设您尝试将源代码添加到项目中。这是行不通的。您需要添加库库而不是源代码。库文件的扩展名为
.jar
。当您从 http://sourceforge.net/projects/jerichohtml 下载 zip 文件时/files/jericho-html/3.1/ 该库位于 zip 的
/jericho-html-3.1/dist/
文件夹中。有关库的使用,请查看示例程序。
You probably want to add library to your project so you could call it in your code.
From the line
import jericho-html-3.1.src.java.net.htmlparser.jericho.*;
I assume that you try to add source code to the project. This will not work.You need to add a library library and not source code. The library file has
.jar
extension.When you download a zip file from http://sourceforge.net/projects/jerichohtml/files/jericho-html/3.1/ The library is in
/jericho-html-3.1/dist/
folder of the zip.For library usage take a look on Sample Programs.
在“项目”窗口中右键单击缺少库的项目名称 ->属性-> “项目属性”窗口打开。在类别树中选择“库”节点 ->在“项目属性”窗口的右侧,按“添加 JAR/文件夹”按钮 ->选择您需要的罐子。
您还可以观看 MockerTim 的短视频操作方法。
In the Projects window right-click on the name of the project that lacks library -> Properties -> The Project Properties window opens. In Categories tree select "Libraries" node -> On the right side of the Project Properties window press button "Add JAR/Folder" -> Select jars you need.
You also can see MockerTim's short Video How-To.