java.lang.NoClassDefFoundError: com/google/protobuf/MessageOrBuilder

5,913 views
Skip to first unread message

minde...@gmail.com

unread,
Jul 12, 2016, 4:33:33 PM7/12/16
to Protocol Buffers
Hi,

I am using protobuf 2.6.1 ( https://developers.google.com/protocol-buffers/docs/downloads ). I compiled the code and used maven to build the protobuf-java-2.6.1.jar

In the addressbook example I removed the initial exit scenario. Whenever the code hits the first protobuf function call I get a java.lang.NoClassDefFoundError: com/google/protobuf/MessageOrBuilder

When I compile I do a javac ProtoTesting.java /com/somedir/trial/TestProtos.java -classpath <somepath>/protobuf-java-2.6.1.jar
When I run I do a java ProtoTesting. After this I get the above error.

Please let me know what I am doing wrong.

Thanks.



minde...@gmail.com

unread,
Jul 13, 2016, 4:20:15 PM7/13/16
to Protocol Buffers
I finally solved it. Finally the way of calling differed. My final string to start off the executable file is as follows:

java -cp "<dir1>/dir<2>/protobuff-2.6.1:" ProtoTest
Reply all
Reply to author
Forward
0 new messages