I've made a small application that reads from an excel (xls file) and displays the contents to a JTable. Everything is working fine in eclipse, yet when I create the jar file and try to run it, I get the following issue:
java.lang.NoClassDefFoundError: org/apache/poi/ss/usermodel/Row
The weird thing I find is that the issue is with the Row, when Workbook and Sheet is called before the row and gives no trouble (at least from what I can see).
I've researched alot and it mainly seems to be with the jar files not being in the Class-Path, but opening the jar and the manifest file I can see all the jars are present.
Class-Path: poi-ooxml-4.0.1.jar poi-4.0.1.jar commons-codec-1.11.jar commons-collections4-4.2.jar commons-math3-3.6.1.jar commons-compress-1.18.jar curvesapi-1.05.jar poi-ooxml-schemas-4.0.1.jar xmlbeans-3.0.2.jar
This is what I have in my pom.xml file:
<build>
<plugins>
<plugin>
<!-- Build an executable JAR -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>./</classpathPrefix>
<mainClass>com.clientdb.classes.DynamicRegForm</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>4.0.1</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>4.0.1</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>4.0.1</version>
</dependency>
</dependencies>
I have also tried downloading the jar files and adding them to the project instead of adding the dependency to pom file, and still the same error. Any ideas?