On 22/04/18 19:28, Cumulative Knowledge wrote:
Hi Andy,
Thanks for the help. I'm still getting the same error. Right now I
have JENAROOT and JENA_HOME set to the same path.
I added classpath like so:
$ export CLASSPATH=$CLASSPATH:$JENA_HOME/lib/*
You need to escape the * to stop it be shell expansion. The * needs to
be passed to java.
export CLASSPATH=$CLASSPATH:$JENA_HOME/lib/\*
Here is what my current classpath:
$ echo $CLASSPATH
This does not agree with the line above - no ":" after whatever
$CLASSPATH was before the export.
/Users/username/Documents/jena/apachejena370/lib/collection-0.7.jar
/Users/username/Documents/jena/apachejena370/lib/commons-cli-1.4.jar
/Users/username/Documents/jena/apachejena370/lib/commons-codec-1.11.jar
/Users/username/Documents/jena/apachejena370/lib/commons-csv-1.5.jar
/Users/username/Documents/jena/apachejena370/lib/commons-io-2.6.jar
/Users/username/Documents/jena/apachejena370/lib/commons-lang3-3.4.jar
/Users/username/Documents/jena/apachejena370/lib/httpclient-4.5.3.jar
/Users/username/Documents/jena/apachejena370/lib/httpclient-cache-4.5.3.jar
/Users/username/Documents/jena/apachejena370/lib/httpcore-4.4.6.jar
/Users/username/Documents/jena/apachejena370/lib/jackson-annotations-2.9.0.jar
/Users/username/Documents/jena/apachejena370/lib/jackson-core-2.9.0.jar
/Users/username/Documents/jena/apachejena370/lib/jackson-databind-2.9.0.jar
/Users/username/Documents/jena/apachejena370/lib/jcl-over-slf4j-1.7.25.jar
/Users/username/Documents/jena/apachejena370/lib/jena-arq-3.7.0.jar
/Users/username/Documents/jena/apachejena370/lib/jena-base-3.7.0.jar
/Users/username/Documents/jena/apachejena370/lib/jena-cmds-3.7.0.jar
/Users/username/Documents/jena/apachejena370/lib/jena-core-3.7.0.jar
/Users/username/Documents/jena/apachejena370/lib/jena-dboe-base-3.7.0.jar
/Users/username/Documents/jena/apachejena370/lib/jena-dboe-index-3.7.0.jar
/Users/username/Documents/jena/apachejena370/lib/jena-dboe-trans-data-3.7.0.jar
/Users/username/Documents/jena/apachejena370/lib/jena-dboe-transaction-3.7.0.jar
/Users/username/Documents/jena/apachejena370/lib/jena-iri-3.7.0.jar
/Users/username/Documents/jena/apachejena370/lib/jena-rdfconnection-3.7.0.jar
/Users/username/Documents/jena/apachejena370/lib/jena-shaded-guava-3.7.0.jar
/Users/username/Documents/jena/apachejena370/lib/jena-tdb-3.7.0.jar
/Users/username/Documents/jena/apachejena370/lib/jena-tdb2-3.7.0.jar
/Users/username/Documents/jena/apachejena370/lib/jsonld-java-0.11.1.jar
/Users/username/Documents/jena/apachejena370/lib/libthrift-0.10.0.jar
/Users/username/Documents/jena/apachejena370/lib/log4j-1.2.17.jar
/Users/username/Documents/jena/apachejena370/lib/slf4j-api-1.7.25.jar
/Users/username/Documents/jena/apachejena370/lib/slf4j-log4j12-1.7.25.jar
/Users/username/Documents/jena/apachejena370/lib/xercesImpl-2.11.0.jar
/Users/username/Documents/jena/apachejena370/lib/xml-apis-1.4.01.jar
Any thoughts?
Thanks,
Louis
On Sun, Apr 22, 2018 at 1:42 AM, Andy Seaborne <[email protected]> wrote:
Louis,
The exception means that the classpth does not contain the jena-core jar.
Put all the jars from the distribution lib directory in the classpath.
Nowadays in java you can put '...\lib\*' on the classpath and it will
include all the jars in that directory.
See the bat scripts in the download or
https://github.com/apache/jena/tree/master/apache-jena/bat
then print out the classpath to make sure it is right.
Andy
On 21/04/18 20:53, Cumulative Knowledge wrote:
I'm getting Apache Jena set up and am having some issues. I think my issue
is with environment variable, but I'm not sure.
Here is what I've posted on Stack Overflow:
Based on this tutorial
<http://staff.um.edu.mt/cabe2/lectures/webscience/docs/jena.pdf> I've
gotten my workspace set up. I've removed the package identifier from my
code
The way to call main is to use it's full name, package included:
java -cp ... <fullname>
java -cp ... a.b.C
where C has the static main method
<https://stackoverflow.com/questions/36402759/error-could-
not-find-or-load-main-class-classdemo>
.
Now I get this error:
Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/jena/rdf/model/ModelFactory at
Tutorial01.main(Tutorial01.java:34)
Caused by: java.lang.ClassNotFoundException:
org.apache.jena.rdf.model.ModelFactory
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
I think it's a JENAROOT Issue. I think I'm setting it and adding it
<https://stackoverflow.com/questions/28177971/tdbloader2-fai
ls-with-classpath-error/28181902#28181902>
to the path correctly. It's also mentioned here
<https://jena.apache.org/documentation/tools/>, but I haven't been able
to
troubleshoot it yet.
Anybody can point me in the right direction?
Thanks,
Louis