I am trying to compile my .proto file using protoc compiler and generate 
java classes for the same.
Below is my Job.proto file

*import "google/protobuf/descriptor.proto";

option java_package = "com.myfile.test";
option java_outer_classname = "JobProto";

message Job{
    required string companyName = 1;
    required string designation = 2;
    required int32 salary = 3;
    required DescriptorProto file_prot = 4;

And my protoc command is 

*protoc %Input%\Job.proto --java_out=%Output% --descriptor_set_out=job.desc 
--proto_path=%Input% --proto_path=%protobuf_src_folder%*

where environment variable definition are: 
Input: Folder in which Job.proto file is present
Output: Foldedr where my output classes are generated
protobuf_src_folder: Path till "..\protobuf-2.4.1\src"

when i execute the above command i get 
*Job.proto:11:18: "DescriptorProto" is not defined.*

I have tried copying the discriptor.proto in the same folder and modifying 
the import statement (still i get the same error). Whatever i have browse i 
just found setting --proto_path properly but in my case the path is proper 
but still i am getting the same error. I have also ensure that my protobuf 
source version and protoc version are same "2.4.1"

Can anyone tell me whats wrong ?

You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To view this discussion on the web visit 
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to