When I used the handle in .proto, I used it as
import "google/protobuf/descriptor.proto"; message AddressBook { required google.protobuf.FileDescriptorSet proto_files = 1;
Then, to generate java (in windows) using addressbookSD.proto in the default directory:
protoc addressbookSD.proto --java_out=./ --proto_path=./ --proto_path=<protobuf-install-directory>\src
where < protobuf-install-directory > is the directory for installing the protocol buffers. The key point is the .proto handle is in
<protobuf-install-directory>\src\google\protobuf
The levels in protobuf import stament should match the directories in the File System, as in java.
So I use < protobuf-install-directory> \ src as the import directory, the directory structure should be
<protobuf-install-directory>\src +-- google +-- protobuf +-- descriptor.proto
source share