The Fuseki single JAR artifact is built using the Shade plugin I often use the shade plugins in my own little projects to create a single JAR to avoid having to worry about the Java class path
Rob On 7/24/13 2:22 PM, "Dan Michael O. Heggø" <[email protected]> wrote: >Thanks guys! > >In fact it didn't come to my mind that the binaries could be >cross-platform, so I didn't even try them on my mac but of course they >work fine :D > >If I need to build it one day, using the fuseki server jar seems like a >good idea. I also came across a maven plugin called "shade" that tells >maven to put all libraries in the output jar: >http://stackoverflow.com/a/10569417/489916 > >Dan Michael > > >On 24 July 2013 09:28, Andy Seaborne <[email protected]> wrote: > >> On 23/07/13 22:15, Joshua TAYLOR wrote: >> ... >> >> > 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: >> ... >> >> Yes - look in the apache-jena area for a freshly built distribution >>(under >> target/ and in your local maven repo). >> >> If you just want the latest development codebase built, that happens >> automatically each "night" (actually about 8am UTC - the build system is >> less busy then): >> >> https://repository.apache.org/**content/repositories/** >> >>snapshots/org/apache/jena/**apache-jena/<https://repository.apache.org/co >>ntent/repositories/snapshots/org/apache/jena/apache-jena/> >> >> so you can pick up a binary distribution for the commands from there. >> >> This includes all the scripts. >> >> If you are changing the source, you'll need to build it. >> >> Each module can be built on it's own, in which case "mvn clean install" >> will put the new jar into target/jena-MODULE.jar and place it in your >>local >> repo. >> >> >> export ARQROOT="$HOME/dev/jena-2.10.**1/jena-arq" >> >> If you want the commands, you want an unpacked binary distribution. The >> scripts are in bin/* and they automatically set the environment root >>JENA >> >> >>https://jena.apache.org/**documentation/tools/index.html<https://jena.apa >>che.org/documentation/tools/index.html> >> >> The environment variable, if you need to set it, is JENAROOT. >> >> ARQROOT is to using the development area of ARQ alone and from Eclipse. >> You want to look in the apache-jena module where there is a binary >> distribution. >> >> There is another set of scripts in jena-arq/bin: these are for working >> with the development system e.g. under Eclipse. These are sensitive to >> class folders. They are also a bit fragile because they assume the >>Eclipse >> setup. >> >> One trick is to use the Fuseki server jar. This is a complete system >>in a >> single jar. It is the only thing you need on the classpath. >> >> java -cp fuseki-server.jar arq.sparql .... >> >> will run the command. The Fuseki server jar includes core jena, ARQ, >>TDB, >> and all their dependencies. >> >> Andy >> >> >> On 23/07/13 22:15, Joshua TAYLOR wrote: >> >>> 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<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 | >>> ---------- >>> >>> >>
