Tuesday, March 04, 2008

Starting a Jena project in Eclipse

As a guide to help new Jena users, I wrote a Complete beginner's guide to starting a Jena project in Eclipse.

del.icio.us: jena, java, semantic-web, tutorial.

8 comments:

mari said...

Hi dear
I couldn't use your starting a jena project in eclipse. my connection has filtered it would you please send it to my email: Maryam_hourali@yahoo.com
Best Regards,
Maryam

Ian said...

Hi Maryam,

I'm surprised that your ISP would filter my web site ... there's nothing there that could trigger any reasonable set of filter rules as far as I know. The zipped archive containing the tutorial is 4.3Mb, so it's a bit large for sending through email. I've uploaded a copy to the Jena file area on Yahoo. See: Jena files area.

Ian

Smriti said...

Hii

I am new to jena and I followed your steps but I am facing a problem. There is an error which states

Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
at com.hp.hpl.jena.rdf.model.impl.PropertyImpl.(PropertyImpl.java:64)
at com.hp.hpl.jena.enhanced.BuiltinPersonalities.(BuiltinPersonalities.java:27)
at com.hp.hpl.jena.rdf.model.impl.ModelCom.(ModelCom.java:51)
at com.hp.hpl.jena.rdf.model.ModelFactory.createDefaultModel(ModelFactory.java:122)
at com.hp.hpl.jena.rdf.model.ModelFactory.createDefaultModel(ModelFactory.java:116)
at tutorial.HelloRDFWorld.main(HelloRDFWorld.java:15)
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
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)
... 6 more

Please guide me how to proceed further.

Best Regards,

Smriti Jain

Ian said...

Hi Smriti,
This should be just a case of adding the slf4j libraries from the lib directory of the Jena download in the 'User libraries' step in the tutorial. If that doesn't work, I'll have a more detailed look. This tutorial is quite old now, and I'm planning to do an updated version when I get time!

Ian

Shehram said...

Hi Ian,

I followed the steps as mentioned in your tutorial. I have configured Jena into Eclipse and there are no errors after the build path has been set. However I am still not getting the correct output. I have tried three different versions of Jena. I think Jena is not configured properly but I even get documentation help on keywords. I am attaching the output below. Can you help out whats the problem?

This the output

Usage: javaw [-options] class [args...]
(to execute a class)
or javaw [-options] -jar jarfile [args...]
(to execute a jar file)

where options include:
-server to select the "server" VM
-hotspot is a synonym for the "server" VM [deprecated]
The default VM is server.

-cp
-classpath
A ; separated list of directories, JAR archives,
and ZIP archives to search for class files.
-D=
set a system property
-verbose[:class|gc|jni]
enable verbose output
-version print product version and exit
-version:
require the specified version to run
-showversion print product version and continue
-jre-restrict-search | -jre-no-restrict-search
include/exclude user private JREs in the version search
-? -help print this help message
-X print help on non-standard options
-ea[:...|:]
-enableassertions[:...|:]
enable assertions
-da[:...|:]
-disableassertions[:...|:]
disable assertions
-esa | -enablesystemassertions
enable system assertions
-dsa | -disablesystemassertions
disable system assertions
-agentlib:[=]
load native agent library , e.g. -agentlib:hprof
see also, -agentlib:jdwp=help and -agentlib:hprof=help
-agentpath:[=]
load native agent library by full pathname
-javaagent:[=]
load Java programming language agent, see java.lang.instrument
-splash:
show splash screen with specified image

Thanks,
Shehram

Shehram said...

Hi Ian,

Wanted to provide you some more info

My Eclipse Version is Indigo Service Release 2 Build id: 20120216-1857.

Jena Version: 2.10.1

Anonymous said...

hi, pls do guide me to store rdf on jena sdb and query it

Ian said...

Hi Anonymous,
Please ask your question on the Jena Users group. See the Jena help page for details on joining the Jena Users email list.