Issue
I currently have a problem with HikariCP, I don't know how to export it in my JAR with Eclipse, note that I don't use maven. If anyone has an idea, thanks in advance.
Error spigot: java.lang.NoClassDefFoundError: com/zaxxer/hikari/HikariDataSource
Solution
The problem you are facing happens because the .jar file does not contain the dependencies/libraries that you are using in development. In runtime, the plugin tries to load some third-party dependency classes but they are not found.
An easy solution to this is to select the option Package required libraries into generated JAR
on the export menu. Here you have a screenshot:
Despite this, just an advice: I strongly recommend you use Maven or Gradle to manage your project build process and dependency import. The Maven Plugin that would pack libraries into the JAR file would be:
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>your.main.class</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
Answered By - PauMAVA
Answer Checked By - Senaida (JavaFixing Volunteer)