【问题标题】:Adding packages in netbeans在netbeans中添加包
【发布时间】:2017-12-16 05:23:58
【问题描述】:

我有一个 Java 文件,我正在尝试编辑它,但是当我在 netbeans 中构建时,我收到以下错误。在我进行更改之前,它运行良好。我不确定为什么 jar 文件以前可以工作,但现在我无法构建它。我是菜鸟...我如何获得这些包裹?谢谢。


C:\Users\Hendrick Brutsaert\Desktop\scrapers\Investing (1)\Investing\src\investing\InvesterMain.java:15: error: package org.jsoup does not exist
import org.jsoup.Jsoup;
C:\Users\Hendrick Brutsaert\Desktop\scrapers\Investing (1)\Investing\src\investing\InvesterMain.java:16: error: package org.jsoup.nodes does not exist
import org.jsoup.nodes.Document;
C:\Users\Hendrick Brutsaert\Desktop\scrapers\Investing (1)\Investing\src\investing\InvesterMain.java:17: error: package org.jsoup.nodes does not exist
import org.jsoup.nodes.Element;
C:\Users\Hendrick Brutsaert\Desktop\scrapers\Investing (1)\Investing\src\investing\InvesterMain.java:18: error: package org.jsoup.select does not exist
import org.jsoup.select.Elements;
C:\Users\Hendrick Brutsaert\Desktop\scrapers\Investing (1)\Investing\src\investing\InvesterMain.java:19: error: package org.openqa.selenium does not exist
import org.openqa.selenium.By;
C:\Users\Hendrick Brutsaert\Desktop\scrapers\Investing (1)\Investing\src\investing\InvesterMain.java:20: error: package org.openqa.selenium does not exist
import org.openqa.selenium.Keys;
C:\Users\Hendrick Brutsaert\Desktop\scrapers\Investing (1)\Investing\src\investing\InvesterMain.java:21: error: package org.openqa.selenium does not exist
import org.openqa.selenium.WebDriver;
C:\Users\Hendrick Brutsaert\Desktop\scrapers\Investing (1)\Investing\src\investing\InvesterMain.java:22: error: package org.openqa.selenium does not exist
import org.openqa.selenium.WebElement;
C:\Users\Hendrick Brutsaert\Desktop\scrapers\Investing (1)\Investing\src\investing\InvesterMain.java:23: error: package org.openqa.selenium.chrome does not exist
import org.openqa.selenium.chrome.ChromeDriver;
C:\Users\Hendrick Brutsaert\Desktop\scrapers\Investing (1)\Investing\src\investing\InvesterMain.java:24: error: package org.openqa.selenium.interactions does not exist
import org.openqa.selenium.interactions.Actions;

【问题讨论】:

    标签: java netbeans import


    【解决方案1】:

    jsoup.jarselenium.jar 的路径似乎定位不正确。 首先从here 下载 jsoup.jar 和从here 下载 selenium.jar 并将它们添加到项目的库中。

    在项目窗口中的 netbeans 中展开您的项目并右键单击库并选择添加 jar/文件夹并找到您的 jsoup.jarselenium.jar 文件位置并添加它们。然后构建项目。

    【讨论】:

      【解决方案2】:

      您应该在项目中包含第三方依赖 jar。

      https://jsoup.org/download http://docs.seleniumhq.org/download/

      您可以从这里下载它们。 编辑您的项目属性,转到库并添加这些 jar。应该这样做。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-09-30
        • 2014-05-19
        • 2013-01-01
        相关资源
        最近更新 更多