有人能指出我正确的方向吗?解决方案我通过 Apache Jena支持电子邮件.我想我一定是在第一次使用时通过更改耶拿的环境变量引起了问题.基于我从社区成员那里收到的脚本,我在终端中运行了一个名为jenaJarsScript.sh的脚本:unset JARSfor f in $JENA_HOME/lib/*.jardo JARS=$JARS:$f export JARSdone然后我将$ JARS添加到我的类路径中-现在我可以编译和运行代码而没有任何问题了. 注意:我不确定这是否是设置此设置的最佳方法,但这对我有用.I may just be going at this wrong, but I am not sure how to interact with Apache Jena on my computer. I think my main question revolves around where I store files and how I run them.I use Atom editor and work in Python and Javascript normally. My goal here is to get a handle of how Jena and Fuseki work then potentially using Fuseki for the backend of a web app.The tutorial, An Introduction to RDF and the Jena RDF API, links to Java files. Where do I store this file on my desktop and how can I run it?While my question is about setting up my workspace/environment, I would appreciate feedback on more appropriate technologies.Based on this tutorial I've gotten my workspace set up. I've removed the package identifier from my code.Now I get this error:Exception in thread "main" java.lang.NoClassDefFoundError:org/apache/jena/rdf/model/ModelFactory atTutorial01.main(Tutorial01.java:34)Caused by: java.lang.ClassNotFoundException:org.apache.jena.rdf.model.ModelFactoryat 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 to the path correctly. It's also mentioned here, but I haven't been able to troubleshoot it yet.Anybody can point me in the right direction? 解决方案 I got help of this via the Apache Jena support email. I think I must have caused an issue by changing the environmental variables for Jena upon first use.Based on a script I received from a community member I ran a script named jenaJarsScript.sh in terminal:unset JARSfor f in $JENA_HOME/lib/*.jardo JARS=$JARS:$f export JARSdoneI then added $JARS to my classpath - now I can compile and run code without an issue.Note: I'm not sure if this is the best way to set this up, but it works for me. 这篇关于如何在本地与Apache Jena交互? - 苹果系统的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-11 01:00