Ariel Ariel - 2 months ago 5x
Java Question

Why do I have these warnings with Jena 2.11.0?

I am using Eclipse and Java. I've setup the jena library and done my first RDF statement using this library, but I get a warning and I don't know exactly what it means.
This is the code:

import com.hp.hpl.jena.datatypes.xsd.XSDDatatype;
import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.rdf.model.Property;
import com.hp.hpl.jena.rdf.model.Resource;

public class Main {

public static void main(String[] args) {
Model m = ModelFactory.createDefaultModel();
String NS = "";
Resource r = m.createResource(NS + "r");
Property p = m.createProperty(NS + "p");
r.addProperty(p, "hello world", XSDDatatype.XSDstring);
m.write(System.out, "Turtle");


And this is the output:

log4j:WARN No appenders could be found for logger (
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See for more info.
<> "hello world"^^<> .

So the code does compile and work but I don't know what to do about this warning.
How can I get rid of it?


I finally managed to solve the problem. Thanks to AndyS for the solution.

Copy the "" file inside the folder of the application and add the following line of code at the start of the main: