Importing "google/protobuf/descriptor.proto" in java protocol buffers
When I have used descriptor in a .proto, I have used it like
import "google/protobuf/descriptor.proto";
message AddressBook {
required google.protobuf.FileDescriptorSet proto_files = 1;
Then to generate the java (on windows) with 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 protocol buffers install directory. The key point is descriptor.proto is in
<protobuf-install-directory>\src\google\protobuf
The levels in an protobuf import stament must match directories in the File system just like they would in java.
So I use <protobuf-install-directory>\src as the import directory, The directory structure must be
<protobuf-install-directory>\src
+-- google
+-- protobuf
+-- descriptor.proto