Sure this is easy and am being thick but bare with me, I am just having a play with Googles protocol buffers examples
So I have created a Java project which lives in ~<USER>/workspace/protocol
In it is AddPerson.java, the file reference a library
com/example/tutorial/AddressBookProtos.java which is in this folder
and also uses the jar which is in
~<USER>/javalib (its called /protobuf-java-2.0.2.jar )
However when I cd to the ~<USER>/workspace/protocol directory and I run
./javac AddPerson.java it gives me the errors
AddPerson.java:15: cannot access com.google.protobuf.GeneratedMessage
file com/google/protobuf/GeneratedMessage.class not found
Person.Builder person = Person.newBuilder();
AddPerson.java:18: cannot access com.google.protobuf.GeneratedMessage$Builder
file com/google/protobuf/GeneratedMessage$Builder.class not found
Could you put me out my misery ? am I missing the point about the CLASSPATH ? should the fact it references ., .. and the library folder containing my jars not be enough?
To use classes in a jar you need to have an entry in the classpath pointing to the .jar file itself not just the directory containing it.
But since JSE 6 you can use wildcards.