Java api with Maven dependencies does NOT start the Stardog server

Hello there!

I have been using Stardog in my Java application using Netbeans IDE and Maven dependencies and everything works fine from Netbeans. I can connect to Stardog server from Netbeans and run all the queries necessary.
However, the same application running from the command prompt does not start the Stardog server and gives me back this error:

Exception in thread "main" java.lang.NoClassDefFoundError: com/complexible/stardog/Stardog
at com.mycompany.mavenApp.MainApp.main(
Caused by: java.lang.ClassNotFoundException: com.complexible.stardog.Stardog
at Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 1 more

I am using Netbeans 8.2 with Java "1.8.0_211", Maven 3.8.1 and Stardog 7.4.3
I have used Maven to compile and package the JAR file and I have included these plugins in my POM file:


I have tried to run the jar file from the command prompt using this command:
java -jar target/mavenApp-1.0-SNAPSHOT.jar

I should say that all the dependencies have been copied into the project directory dependency-jars at the time of maven compiling and packaging (mvn compile package).

PS: I also have the %STARDOG_HOME% system variable and path defined.

Any help is greatly appreciated!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.