Reputation: 4800
The documentation for using Google Protobuf for Java in Windows environment is not very friendly, scattered and puts the new user into confusion. Here is a small attempt to assist the new explorers.
Upvotes: 5
Views: 12366
Reputation: 1062560
As a simpler approach, especially for occasional users, you could also just:
Current limitations:
Upvotes: 3
Reputation: 4800
To run the examples in the library -
protoc.exe
from step 1 above to a preferred location and ensure that location is added into the Path
environment variable. To ensure it is done properly, open a new command prompt and run protoc --version
to see the appropriate version you installed.Create the Java package for protocol format given with the examples - defined in addressbook.proto
as explained here - protoc -I=$SRC_DIR --java_out=$DST_DIR $SRC_DIR/addressbook.proto
- This generates the required AddressBookProtos
class under the package com.example.tutorial
which is required for compiling the example code.
Once the generated code is in the example classpath, the code can be executed.
Upvotes: 9