Does the jarfile: BasicNameFinder-1.0-SNAPSHOT.jar contain the class file: my.org.phrases.BasicNameFinder?
I assume that is true otherwise the java command wouldn't find that class. If the class was not in the jarfile, the classpath from the -cp would have to refer to the class's path as pointed out in Knute's second point.
If there are other jarfiles that need to be on the classpath, they need to be listed in the -cp option or they could be referenced from the manifest file's Class_Path line.
My project directory is <my_home>/src/phrases. That's where pom.xml is.
When I run "mvn clean package" I get a jar file here: <my_home>/src/phrases/target/BasicNameFinder-1.0-SNAPSHOT.jar
The first line of <my_home>/src/main/java/my/org/phrases/BasicNameFinder.java is this:
The classpath for the java program needs to have the jarfile for your program's classes and the jarfile for the Tokenizer class. I don't know what the path separator is for a Mac.
On Windows the command would be like this with a ; separating the paths:
java -cp BasicNameFinder-1.0-SNAPSHOT.jar;opennlp-tools-1.6.0.jar org.my.phrases.BasicNameFinder
I left off the full path and just used the jarfile to simply the command.
I think it's time for me to start a new thread if questions about Maven are appropriate on this forum. I've got my java source, the OpenNLP jars, and now the slf4j stuff. I've added dependencies on slf4j-api and on opennlp-tools in the pom.xml but Maven isn't doing anything with them as far as I can tell. That's why I'm referencing the opennlp jars in the first place, which I built as a different Maven project.