package com.google.protobuf does not exist error while trying to build ProtoBuf Java component

8,603 views
Skip to first unread message

Prag Thiru

unread,
Apr 1, 2018, 1:19:42 PM4/1/18
to Protocol Buffers

Previously I was able to run make all and make java. I did a make clean after which make java fails with com/example/tutorial/AddressBookProtos.java:95: error: package com.google.protobuf does not exist.

I followed this SO post, but it fails.


How can I fix this error? Thanks!


examples $protoc --version
libprotoc 3.5.1

examples $make java
make: Nothing to be done for `java'.

examples $make clean
rm -f add_person_cpp list_people_cpp add_person_java list_people_java add_person_python list_people_python
rm -f javac_middleman AddPerson*.class ListPeople*.class com/example/tutorial/*.class
rm -f protoc_middleman addressbook.pb.cc addressbook.pb.h addressbook_pb2.py com/example/tutorial/AddressBookProtos.java
rm -f *.pyc
rm -f protoc_middleman_go tutorial/*.pb.go add_person_go list_people_go
rmdir tutorial 2>/dev/null || true
rmdir com/example/tutorial 2>/dev/null || true
rmdir com/example 2>/dev/null || true
rmdir com 2>/dev/null || true

examples $make java
protoc $PROTO_PATH --cpp_out=. --java_out=. --python_out=. addressbook.proto
javac -cp $CLASSPATH AddPerson.java ListPeople.java com/example/tutorial/AddressBookProtos.java
com/example/tutorial/AddressBookProtos.java:95: error: package com.google.protobuf does not exist
      com.google.protobuf.GeneratedMessageV3 implements
                         ^
com/example/tutorial/AddressBookProtos.java:19: error: package com.google.protobuf does not exist
      com.google.protobuf.MessageOrBuilder {
...

Feng Xiao

unread,
Apr 2, 2018, 6:16:18 PM4/2/18
to prag...@gmail.com, Protocol Buffers
Try following the instructions in examples/README.md and define CLASSPATH properly:
--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+u...@googlegroups.com.
To post to this group, send email to prot...@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages