How to configure trial license in running stardog api?

I was trying to run this example in Eclipse:
https://github.com/stardog-union/bites-corenlp

I downloaded a trial license and it works with my Stardog server at command line or Studio. But where to put this trial license in order to run this tutorial in api call in Eclipse?

I am seeing this piece of code in the unit test:

    try (AdminConnection aConn = AdminConnectionConfiguration.toEmbeddedServer()
    		                                                         .credentials("admin", "admin")
    		                                                         .connect()) {
    			if (aConn.list().contains(DB)) {
    				aConn.drop(DB);
    			}

    			aConn.newDatabase(DB).set(SearchOptions.SEARCHABLE, true).create();
    		}

How to configure the trial license in the EmbeddedServer?

By default it will look for the license in the install directory which can be set with the STARDOG_HOME env variable. You can set the home directory by calling Stardog.builder().home("/my/home") and making sure you've copied the license to this directory. I think there may be a better way since they added the STARDOG_LICENSE_PATH env variable. I'd be interested in knowing how that works.

EDIT: It looks like there's a configuration option StardogConfiguration.LICENSE_LOCATION so it might be somethign like `Stardog.builder().set(StardogConfiguration.LICENSE_LOCATION, "my/location")

Hi, zachary:

For another tutorial,

I am running into this problem:

Could not get unknown property 'stardogLib' for root project 'stardog-examples' of type org.gradle.api.Project.

I am running it in IntelliJ with JDK 8.

That probably has something to do with setting the native library path for java. (-Djava.library.path). It needs to be set to the lib directory in the Stardog installation directory. I'd have to see what's going on but that should give you somewhere to start until I or someone else gets a chance to look at it.

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