java 如何在netbeans项目中导入zip文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5143921/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-30 09:40:48  来源:igfitidea点击:

How to import zip file in netbeans project

javanetbeanszipimport

提问by Aruna

when I was trying import a zip file in my netbeans project, I get a error in this line
import jericho-html-3.1.src.java.net.htmlparser.jericho.*;

当我尝试在我的 netbeans 项目中导入一个 zip 文件时,在这一行中出现错误
import jericho-html-3.1.src.java.net.htmlparser.jericho.*;

even though I added the zip file Libraries folder.

即使我添加了 zip 文件库文件夹。

回答by amra

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.

您可能希望将库添加到您的项目中,以便您可以在您的代码中调用它。从这一行开始,import jericho-html-3.1.src.java.net.htmlparser.jericho.*;我假设您尝试将源代码添加到项目中。这是行不通的。

You need to add a library library and not source code. The library file has .jarextension. 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.

您需要添加库库而不是源代码。库文件有.jar扩展名。当您从http://sourceforge.net/projects/jerichohtml/files/jericho-html/3.1/下载 zip 文件时,库位于 zip 文件/jericho-html-3.1/dist/夹中。

For library usage take a look on Sample Programs.

有关库的使用,请查看示例程序

回答by Mehdi Benkirane

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.

在 Projects 窗口中右键单击缺少库的项目名称 -> Properties -> Project Properties 窗口打开。在类别树中选择“库”节点 -> 在项目属性窗口的右侧按下按钮“添加 JAR/文件夹” -> 选择您需要的 jar。

You also can see MockerTim's short Video How-To.

您还可以看到MockerTim的短视频操作方法