Homework #1 FAQ

1. When I run Jena, I get the following messages:
   log4j:WARN No appenders could be found for logger (org.apache.jena.util.FileManager).
   log4j:WARN Please initialize the log4j system properly.
   log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for
more info. 
How do I fix this?
Jena uses log4j to manage and record its error messages. To make sure it works properly with your system, you need to tell Java how you want log4j to be configured. To do this:
2. How do I read from a tab-delimited text file, so that multi-word album titles and artist names are kept together as a single string?
You have two choices, both use the java.util.Scanner class for simplicity.
Scanner input = new Scanner(myFile);
3. When I try to run my program at the command line, it cannot find the Jena classes. How do I fix this?
The Jena class are in JAR files, which can be found in Jena's lib folder. You need to tell the JVM the location of these files. You do this using the -cp option, e.g.:
java -cp C:/Users/heflin/Documents/Code/apache-jena-2.12.0/lib/*;. userid.AlbumsToRdf top20albums.txt
In Unix, Linux and Mac, you will need to change the separator character used for classpaths from ";" to ":":
java -cp C:/Users/heflin/Documents/Code/apache-jena-2.12.0/lib/*:. userid.AlbumsToRdf top20albums.txt