eclipse中导入jena:
Step 1 create a Java project
Eclipse organizes files into projects, so we need a project for this tutorial. Depending on the plugins installed, Eclipse may show a large number of different types of project. A plain Java project is fine for a basic Jena application. If you want to, for example, develop a Java servlet that uses Jena, then choose a suitable project type.
For clarity, I'm starting with an empty Eclipse workspace:
I need to create a new Java project:
Next I need to set up the internal structure of the project. There are many schools of thought on this. I usually use a basic structure that is taken from Maven. Source code is in src/main
, with Java code in src/main/java
, ontologies insrc/main/owl
, etc. Compiled Java class files go into target/classes
. So when I create a new project, I edit the defaults to reflect these preferences. However, if the defaults suit you, or you don't know enough to care about those details yet, just accept the default settings. Alternatively, if your project or educational institution has suggested guidelines, then go with those.
Step 2: create the hello world class
Java code is stored in files that correspond to the declaration of a Java class, so I need to create a class for my