How to add functionality from a JAR to an application?

0
I would like to add functionality from Free Spire (https://www.e-iceblue.com/Download/presentation-for-java-free.html) to my application Just wondering how easy it is to install this whole package? It's a JAR file and I can't seem to find proper instructions on how to add this to my app. Can anyone point me to a suitable source? Almost all the links on the forum are wrong and lead to sites that don't exist
asked
2 answers
0

TL;DR; the jar has no dependencies . You can just download it and put it into userlib/ . Here’s the direct link https://repo.e-iceblue.com/nexus/content/groups/public/e-iceblue/spire.presentation.free/5.1.0/spire.presentation.free-5.1.0.jar

 

 

To download a jar with all dependencies you also need to download  apache-maven-3.9.3-bin.zip at https://maven.apache.org/download.cgi

and then follow https://maven.apache.org/install.html

The important part is “ Have a JDK installation on your system. Either set the JAVA_HOME

 

You already have OpenJDK installed at C:\Program Files\AdoptOpenJDK\

jdk-11.0.3.7-hotspot\

 

Set JAVA_HOME and PATH using the dialog “Change my environment variables” (shortcut win-r,

rundll32.exe sysdm.cpl,EditEnvironmentVariables

)

 

Create an xml file, name it pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>foo</groupId>
  <artifactId>bar</artifactId>
  <version>0.1-SNAPSHOT</version>
  <packaging>war</packaging>

  <name>bar</name>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>
    <dependency>
      <groupId>e-iceblue</groupId>
      <artifactId>spire.presentation.free</artifactId>
      <version>5.1.0</version>
    </dependency>
  </dependencies>


  <repositories>
    <repository>
      <id>com.e-iceblue</id>
      <name>e-iceblue</name>
      <url>https://repo.e-iceblue.com/nexus/content/groups/public/</url>
    </repository>
  </repositories>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.2</version>
        <configuration>
          <failOnMissingWebXml>false</failOnMissingWebXml>
        </configuration>
      </plugin>

    </plugins>
  </build>

</project>

 

Open command prompt where pom.xml is saved and run this command: mvn package

 

It will download the jar and its dependencies into target\bar-0.1-SNAPSHOT\WEB-INF\lib\

 

 

answered
0

Honestly? It doesn't have much to do with "low-code" :P
 

But of course I tried it and unfortunately it doesn't work. I tested it with mvn -v and I get the message

The JAVA_HOME environment variable is not defined correctly,
this environment variable is needed to run this program.

And it looks like it is installed correctly

answered