Compilation errors with generated java file

882 views
Skip to first unread message

Kenneth Miller

unread,
Nov 29, 2014, 7:08:09 PM11/29/14
to prot...@googlegroups.com
Title says it all; 

"mvn compile" produces tons of errors, here's the first:

[ERROR] $HOME/workspace/JavaExamplePBServiceCall/src/main/java/example/ServicecallPiqi.java:[13,23] error: ';' expected

manual compilation produces 100 errors, here is the first:

javac -cp $HOME/.m2/repository/com/google/protobuf/protobuf-java/2.4.1/protobuf-java-2.4.1.jar ServicecallPiqi.java

ServicecallPiqi.java:535: error: cannot find symbol
    public static com.google.protobuf.Parser<params> PARSER =
                                     ^
  symbol:   class Parser
  location: package com.google.protobuf

Beginning of ServicecallPiqi.java:

package example;
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: pb_piqi_out/servicecall.piqi.proto

public final class ServicecallPiqi {
  private ServicecallPiqi() {}
  public static void registerAllExtensions(
      com.google.protobuf.ExtensionRegistry registry) {
  }
  /**
   * Protobuf enum {@code cast_type}
   */
  public enum cast_type implements
//  ^^^^^^^^^^^^^ OFFENDING line 


How do I get it to compile?

Oliver Jowett

unread,
Dec 1, 2014, 2:01:44 PM12/1/14
to Kenneth Miller, Protocol Buffers
On 30 November 2014 at 00:08, Kenneth Miller
<kennetha...@gmail.com> wrote:

> manual compilation produces 100 errors, here is the first:
>
> javac -cp
> $HOME/.m2/repository/com/google/protobuf/protobuf-java/2.4.1/protobuf-java-2.4.1.jar
> ServicecallPiqi.java
>
> ServicecallPiqi.java:535: error: cannot find symbol
> public static com.google.protobuf.Parser<params> PARSER =
> ^
> symbol: class Parser
> location: package com.google.protobuf

Your protoc version does not match your library version; they must be the same.

Oliver
Reply all
Reply to author
Forward
0 new messages