Install Aspose.HTML for Java

Aspose.HTML for Java is available from the official Aspose repository. Maven or Gradle is recommended for most Java projects because the build tool records the dependency, resolves it during the build, and makes later updates straightforward. You can also download the release package and add the required JAR manually in restricted or offline environments.

For most projects, add https://releases.aspose.com/java/repo/ as a package repository and use the com.aspose:aspose-html dependency. Replace ASPOSE_HTML_VERSION in the examples with an exact version listed on the Aspose.HTML for Java Releases page.

Install Aspose.HTML for Java with Maven

Add the Aspose repository and Aspose.HTML dependency to your Maven pom.xml:

  1. Open the pom.xml file in your Java project.
  2. Add the Aspose repository to the <repositories> section.
  3. Add com.aspose:aspose-html to the <dependencies> section.
  4. Save the file and reload or rebuild the Maven project.
 1<repositories>
 2    <repository>
 3        <id>AsposeJavaAPI</id>
 4        <url>https://releases.aspose.com/java/repo/</url>
 5    </repository>
 6</repositories>
 7
 8<dependencies>
 9    <dependency>
10        <groupId>com.aspose</groupId>
11        <artifactId>aspose-html</artifactId>
12        <version>ASPOSE_HTML_VERSION</version>
13    </dependency>
14</dependencies>

Run the following command from the project directory to resolve dependencies and compile the project:

1mvn compile

Install Aspose.HTML for Java with Gradle

Add the repository and dependency to the Groovy DSL build.gradle file. The following configuration assumes that the Gradle Java plugin is already applied in the project:

  1. Open build.gradle in your Java project.
  2. Add the Aspose Maven repository to repositories.
  3. Add Aspose.HTML with the implementation dependency configuration.
  4. Reload the Gradle project or run the build.
1repositories {
2    maven {
3        url = uri('https://releases.aspose.com/java/repo/')
4    }
5}
6
7dependencies {
8    implementation 'com.aspose:aspose-html:ASPOSE_HTML_VERSION'
9}

For the Kotlin DSL build.gradle.kts file, use:

1repositories {
2    maven {
3        url = uri("https://releases.aspose.com/java/repo/")
4    }
5}
6
7dependencies {
8    implementation("com.aspose:aspose-html:ASPOSE_HTML_VERSION")
9}

Run the following command from the project directory to resolve dependencies and build the project:

1gradle build

Install Aspose.HTML Manually

Use manual installation when Maven or Gradle cannot access an external repository:

  1. Open Aspose.HTML for Java Releases.
  2. Select the required version and download its release package or JAR artifact.
  3. Add the JAR to your project dependencies or Java classpath using your IDE or build process.
  4. Build the project and confirm that Aspose.HTML packages resolve.

Manual JAR references are not updated automatically. When upgrading, replace the old artifact and verify that the project no longer references the previous version.

Update Aspose.HTML for Java

To update a Maven or Gradle project, change the version in pom.xml or build.gradle to a version listed on the official releases page, then reload dependencies and rebuild the project. Review the release notes before upgrading an existing application.

Common Installation Issues

IssueLikely causeFix
Maven or Gradle cannot resolve com.aspose:aspose-htmlThe repository is missing or unavailable, or the requested version is not published.Configure https://releases.aspose.com/java/repo/, select an exact version from Aspose.HTML for Java Releases, and reload dependencies.
Aspose.HTML packages are unresolved in the IDEThe project model has not been reloaded, dependency resolution failed, or the dependency was added to another module.Reload the Maven or Gradle project, inspect the dependency tree, and verify the correct module configuration.
An old Aspose.HTML version remains after an updateThe build file still pins the old version or the dependency cache has not been refreshed.Check all project modules, update the version, refresh dependencies, and rebuild the project.

After installation, continue with How to Run the Examples or follow the first HTML to PDF workflow in Getting Started. Installation does not remove evaluation limitations; see Licensing when you are ready to apply a temporary or purchased license.