How To Install libhtmlunit-core-js-java on Debian 9

In this tutorial we learn how to install libhtmlunit-core-js-java on Debian 9. libhtmlunit-core-js-java is GUI-Less browser for Java programs - JavaScript engine

Introduction

In this tutorial we learn how to install libhtmlunit-core-js-java on Debian 9.

What is libhtmlunit-core-js-java

libhtmlunit-core-js-java is:

HtmlUnit is a “GUI-Less browser for Java programs”. It models HTML documents and provides an API that allows you to invoke pages, fill out forms, click links, etc… just like you do in your “normal” browser.

It has fairly good JavaScript support (which is constantly improving) and is able to work even with quite complex AJAX libraries, simulating either Firefox or Internet Explorer depending on the configuration you want to use.

It is typically used for testing purposes or to retrieve information from web sites.

HtmlUnit is not a generic unit testing framework. It is specifically a way to simulate a browser for testing purposes and is intended to be used within another testing framework such as JUnit or TestNG.

This package contains the JavaScript intepreter, based on the Rhino engine.

There are three methods to install libhtmlunit-core-js-java on Debian 9. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install libhtmlunit-core-js-java Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install libhtmlunit-core-js-java using apt-get by running the following command:

sudo apt-get -y install libhtmlunit-core-js-java

Install libhtmlunit-core-js-java Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install libhtmlunit-core-js-java using apt by running the following command:

sudo apt -y install libhtmlunit-core-js-java

Install libhtmlunit-core-js-java Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Debian. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install libhtmlunit-core-js-java using aptitude by running the following command:

sudo aptitude -y install libhtmlunit-core-js-java

How To Uninstall libhtmlunit-core-js-java on Debian 9

To uninstall only the libhtmlunit-core-js-java package we can use the following command:

sudo apt-get remove libhtmlunit-core-js-java

Uninstall libhtmlunit-core-js-java And Its Dependencies

To uninstall libhtmlunit-core-js-java and its dependencies that are no longer needed by Debian 9, we can use the command below:

sudo apt-get -y autoremove libhtmlunit-core-js-java

Remove libhtmlunit-core-js-java Configurations and Data

To remove libhtmlunit-core-js-java configuration and data from Debian 9 we can use the following command:

sudo apt-get -y purge libhtmlunit-core-js-java

Remove libhtmlunit-core-js-java configuration, data, and all of its dependencies

We can use the following command to remove libhtmlunit-core-js-java configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge libhtmlunit-core-js-java

Dependencies

libhtmlunit-core-js-java have the following dependencies:

References

Summary

In this tutorial we learn how to install libhtmlunit-core-js-java package on Debian 9 using different package management tools: apt, apt-get and aptitude.