Sorry what do you mean by updating the config
include the java.library.path
in your pom file.
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<configuration>
<mainClass>com.myPackage.myClass</mainClass>
<commandlineArgs>-Djava.library.path=${env.STARDOG_HOME}/lib</commandlineArgs>
</configuration>
</plugin>
</plugins>
</build>
It is my fourth day trying to run stardog and I cannot
With the second option also is not working
Can you share your code?
Sure.
My code is to simple
import com.complexible.common.protocols.server.Server;
import com.complexible.stardog.Stardog;
import com.complexible.stardog.StardogException;
import com.complexible.stardog.api.Connection;
import com.complexible.stardog.api.ConnectionConfiguration;
import com.complexible.stardog.api.SelectQuery;
import com.complexible.stardog.api.admin.AdminConnection;
import com.complexible.stardog.api.admin.AdminConnectionConfiguration;
import com.complexible.stardog.api.reasoning.ReasoningConnection;
import com.complexible.stardog.rdf4j.StardogRepository;
public class StardogTestDriver {
public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub
String myDB = "/project/6008168/tamouze/STARDOG_HOME/myDB";
Stardog aStardog = Stardog.builder().create();
System.out.println("Done...");
}
}
and my pom.xml is
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>rdf4j-getting-started</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>HelloRDF4J</name>
<repositories>
<repository>
<id>stardog-public</id>
<url>https://maven.stardog.com</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.eclipse.rdf4j</groupId>
<artifactId>rdf4j-bom</artifactId>
<version>3.0.4</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.complexible.stardog</groupId>
<artifactId>client-http</artifactId>
<version>7.3.0</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>com.complexible.stardog</groupId>
<artifactId>server</artifactId>
<version>7.3.0</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>com.complexible.stardog.rdf4j</groupId>
<artifactId>stardog-rdf4j</artifactId>
<version>7.3.0</version>
</dependency>
<dependency>
<groupId>org.eclipse.rdf4j</groupId>
<artifactId>rdf4j-storage</artifactId>
<type>pom</type>
<version>3.0.4</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.0.13</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>utf8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<configuration>
<mainClass>StardogTestDriver</mainClass>
<commandlineArgs>-Djava.library.path=${env.STARDOG}/lib</commandlineArgs>
</configuration>
</plugin>
</plugins>
</build>
</project>
You need to set that option in MAVEN_OPTS
export MAVEN_OPTS=-Djava.library.path=$STARDOG/lib
although it's not the best way to do it since it's set for everything. Alternatively you can configure it by using the exec goal instead of the java goal. Yayyy maven.
I think you remember that it was not working through mvn exec:java -Djava.library.path=$STARDOG/lib
I just spent the weekend installing Windows to point out that you missed a step in the installation instructions. Why don't you humor me and give it a try.
No no , im so sorry, i appreciate your help and time. For the windows version, i will try it and give you my feedbacks. Im just talking about the linux version installation with maven.
I am so sorry again, you are the best
But give it a try. It didn’t work for me passing it as an argument but did work using MAVEN_OPTS
Im so sorry it is not working.
I did
1-
export MAVEN_OPTS=-Djava.library.path=$STARDOG/lib
then
2-
mvn compile
3-
mvn exec:java
I get the old exception. By the way according to what you suggest i can see in the error the following
11:05:16.171 [StardogTestDriver.main()] ERROR com.stardog.starrocks.StarrocksUtils - Unable to load native library(Starrocks-CentOS-7):
java.library.path =
LD_LIBRARY_PATH = {/opt/software/slurm/lib}
java.lang.UnsatisfiedLinkError: no Starrocks-CentOS-7 in java.library.path
Ugh, frustrating, I know. I was able to get what you sent working by setting MAVEN_OPTS.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.