On Tue, Jul 23, 2013 at 3:14 PM, Dan Michael O. Heggø
<[email protected]> wrote:
> Hi, this is probably a "stupid question", but I have no experience with
> Maven and very little with Java, so I'm quite stuck right now. I have Maven
> 3.0.5 installed, and here's what I've tried to install arq:
>
>> cd $HOME/dev
>> wget http://www.apache.org/dist/jena/source/jena-2.10.1-source-release.zip
>> unzip jena-2.10.1-source-release.zip
>> cd jena-2.10.1
>> mvn install
>
> Builds fine and tests run fine. Here's a complete log:
> http://pastebin.com/7yBvdChH
>
> Next I did:
>
>> export ARQROOT="$HOME/dev/jena-2.10.1/jena-arq"
>> export PATH="$PATH:$HOME/dev/jena-2.10.1/jena-arq/bin"
>> arq_path
>
> /Users/danmichael/dev/jena-2.10.1/jena-arq/target/classes
>
>> arq
>
> Exception in thread "main" java.lang.NoClassDefFoundError:
> com/hp/hpl/jena/shared/JenaException
>  at arq.arq.main(arq.java:34)
> Caused by: java.lang.ClassNotFoundException:
> com.hp.hpl.jena.shared.JenaException
> at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
>  at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
> at java.security.AccessController.doPrivileged(Native Method)
>  at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
>  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
>  ... 1 more
>
>
> After taking a look at the arq bin file, I tried
>
>> java -cp jena-core/target/classes:jena-arq/target/classes: arq.arq
>
> but then I just got another NoClassDefFoundError for
> "org/apache/log4j/PropertyConfigurator" instead. I didn't manage to find
> that class. Could there be some path I have not set (correctly)?

I use the binary distribution, so I don't know if this is the *right*
way to do this, but this may get you going until someone can respond
with an authoritative answer:

After you've downloaded and built Jena, there are lots of jars scattered about:

taylorj@kamja:~/Downloads/jena-2.10.1$ find . -iname "*.jar"
./jena-core/target/jena-core-2.10.1-javadoc.jar
./jena-core/target/jena-core-2.10.1-test-sources.jar
...
./jena-iri/target/jena-iri-0.9.6-sources.jar
./jena-iri/target/jena-iri-0.9.6-javadoc.jar
./jena-iri/target/jena-iri-0.9.6.jar

If, under the apache-jena directory, you make a lib directory and put
the jars there, and use the arq binary that in apache-jena/bin, you'll
be all set:

taylorj@kamja:~/Downloads/jena-2.10.1$ mkdir apache-jena/lib
taylorj@kamja:~/Downloads/jena-2.10.1$ find . -iname "*.jar" -exec cp
\{\} ./apache-jena/lib/ \;

You'll get a bunch of warnings there when it tries to copy from
apache-jena/lib into apache-jena/lib, but that's just because I didn't
write a better find that would exclude from searching there.  Now you
should be able to run arq:

taylorj@kamja:~/Downloads/jena-2.10.1$ ./apache-jena/bin/arq
No query string or query file

taylorj@kamja:~/Downloads/jena-2.10.1$ ./apache-jena/bin/arq --data
~/.../data.n3 --query ~/.../subquery.sparql
----------
| y      |
==========
| :node3 |
----------

-- 
Joshua Taylor, http://www.cs.rpi.edu/~tayloj/

Reply via email to