Java: how to setup htmlunit

Now, I download htmlunit 2.7 and unzipped the folder, which contains a "lib" folder with a bunch of jar files in it. Where do I put that lib folder in my netbeans project folder so that I can use htmlunit?

First, register the libraries in the IDE.

  1. In the IDE, choose Tools > Libraries to open the Libraries Manager.
  2. Click New Library and provide a name for the library, e.g. "HTMLUnit"
  3. With the "HTMLUnit" library selected, click on the "Add JAR/Folder..." button and select the jar file that was downloaded earlier and click OK to complete

alt text
(source: netbeans.org)

Then, add the libraries to the project you are working on.

  1. Select the project from the Project view, right-click and select "Properties"
  2. Under the Libraries category, click on the "Add Library..." button and choose the HTMLUnit library and click OK to complete

alt text
(source: netbeans.org)

(...) Where do the the com.gargoylesoftware come from?

From the library you have to add (more precisely, from the htmlunit jars).

Tags:

Java

Htmlunit