title: Compilation error when installing Protocol Buffers
body: <p>Have been trying to install Protocol Buffers compiler and java runtime installation, but I'm getting an error when compiling the java classes. I downloaded:</p>
  
  <ul>
  <li><p>protoc-3.2.0rc2-linux-x86_64.zip (although it says the version is 2.6.1)</p></li>
  <li><p>protobuf-java-3.2.0rc2.zip</p></li>
  </ul>
  
  <p>The file structure looks like this:</p>
  
  <ul>
  <li>project/
  
  <ul>
  <li>protobuf_dir/
  
  <ul>
  <li>the protobuf files/directories including src/ and java/</li>
  <li>src/
  
  <ul>
  <li>protoc (binary)</li>
  <li>protoc_dir/ (the other bits and bobs from protoc zip file)</li>
  </ul></li>
  <li>java/
  
  <ul>
  <li>core/</li>
  <li>lite/</li>
  <li>...</li>
  </ul></li>
  </ul></li>
  </ul></li>
  </ul>
  
  <p>So assuming that's all fine, I typed in:</p>
  
  <pre><code>protoc --java_out=src/main/java -I../src \../src/google/protobuf/descriptor.proto
  </code></pre>
  
  <p>So protoc seems to be working fine. But then I kept getting errors like these until I commented them out (not sure if that is a problem?):</p>
  
  <pre><code>google/protobuf/descriptor.proto:443:3: Expected "required", "optional", or "repeated".
  google/protobuf/descriptor.proto:443:12: Expected field name.
  google/protobuf/descriptor.proto:541:3: Expected "required", "optional", or "repeated".
  google/protobuf/descriptor.proto:541:12: Expected field name.
  </code></pre>
  
  <p>But when I try compiling all the java classes, I just keep getting an error saying:</p>
  
  <pre><code>Descriptors.java:1175: error: cannot find symbol
      return FieldDescriptorProto.Type.forNumber(ordinal() + 1);
  </code></pre>
  
  <p>Any ideas on how to solve the problem? Can't see why it shouldn't compile. Tried looking on Google's page but nothing comes up on this.</p>
  
  <p>Aware I sound a bit clueless although I've never really used libraries like protobuf from Github before so this is all new to me!</p>
  
  <p>EDIT: Hi all, this issue was resolved with exactly the same file structure. I uninstalled protoc2.6.1, set my $JAVA_HOME and $PATH variables (you should store them too rather than having to export them every time), installed maven (properly).</p>
  
  <p>All is well! Everything compiled without a hitch. Thanks to the responder!</p>