-1

I clicked file->project structure->libraries and added apache-jena-3.0.0/lib,/libsrc and javadoc-core.

Then I copied the tutorial in the src-example folder to the src file of my intellij project, then

import com.hp.hpl.jena.rdf.model.*;
import com.hp.hpl.jena.vocabulary.*;

public class Tutorial01 extends Object {
    // some definitions
    static String personURI    = "http://somewhere/JohnSmith";
    static String fullName     = "John Smith";

      public static void main (String args[]) {
        // create an empty model
        Model model = ModelFactory.createDefaultModel();

       // create the resource
       Resource johnSmith = model.createResource(personURI);

      // add the property
      johnSmith.addProperty(VCARD.FN, fullName);
      }
}

Then it said couldn't resolve hp, MOdel, Resource. Anyone knows why?

jena version 3.0.0
ubuntu 15.04
intellij 14.1.4
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)
whereis java: /jvm/java-8-oracle/jre/bin/java

enter image description here

1
  • On the left side of IntelliJ there's a project view, do you have your library listed here (bottom)? If so, click all the "+" of the library tree and post a screenshot of that in your question
    – user180100
    Oct 23, 2015 at 18:54

2 Answers 2

1

Jena 3.0.0 renamed the packages (one reason for being a major version change).

com.hp.hpl.jena => org.apache.jena.

1
  • You haven't changed Tutorial09.
    – AndyS
    Oct 25, 2015 at 20:36
0

Finally I found a solution.

I put all the jar file in the project folder and add them, now it works.

But if the jar files are not in the project folder, using -project setting library import does not work

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.