0

I am trying to communicate my Server with another Cloud service which speaks through a specific protocol that was developed based on Google Protocol Buffer. I wrote a Java program in Netbeans which is able to read messages from this Cloud service, but these messages appear in my console in an unreadable format. I was said that I must have installed the appropriate protocol to interpret these messages. So, I installed google protocol buffer for Java and Win: https://github.com/google/protobuf/releases/tag/v3.5.0

Now, I am trying to use protoc commands in cmd to compile my Java program (which reads the input messages from cloud service) to be able to read the incoming data in understandable format.

Can anyone help me answer these two questions:

  1. Real working example of using Protoc to compile a Java program? Google says use this: protoc -I=$SRC_DIR --java_out=$DST_DIR $SRC_DIR/addressbook.proto https://developers.google.com/protocol-buffers/docs/javatutorial

But I am not able to get this syntax work

  1. What output would this command generate and how/where can I use it to interpret the messages I am receiving in the Netbeans console (with my Java program created in Netbeans)?

Thank you!

Vinraj
  • 141
  • 1
  • 2
  • 9
  • 1
    protoc doesn't compile java programs. It compiles proto files to java (source code) files. – tkausl Dec 13 '17 at 22:36
  • I was kind of not clear on that. Thanks for clarifying. I will edit my question. – Vinraj Dec 14 '17 at 00:08
  • "But I am not able to get this syntax work" ' what happens? Do you get an error message? If so: what? What should happen is that this generates some java source files into the $DST_DIR that you compile in your chosen Java toolset – Marc Gravell Dec 14 '17 at 22:22
  • Hi,I am trying this command: protoc -I=C:\BestMile\Proto_files\Hermes_Core --java_out=C:\BestMile\Proto_files\Hermes_Core C:\BestMile\Proto_files\Hermes_Core\common.proto – Vinraj Dec 15 '17 at 17:24

0 Answers0