README.txt 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. Protocol Buffers - Google's data interchange format
  2. Copyright 2008 Google Inc.
  3. This directory contains the Java Protocol Buffers runtime library.
  4. Installation - With Maven
  5. =========================
  6. The Protocol Buffers build is managed using Maven. If you would
  7. rather build without Maven, see the next section.
  8. 1) Install Apache Maven if you don't have it:
  9. http://maven.apache.org/
  10. 2) Build the C++ code, or obtain a binary distribution of protoc. If
  11. you install a binary distribution, make sure that it is the same
  12. version as this package. If in doubt, run:
  13. $ protoc --version
  14. You will need to place the protoc executable in ../src. (If you
  15. built it yourself, it should already be there.)
  16. 3) Run the tests:
  17. $ mvn test
  18. If some tests fail, this library may not work correctly on your
  19. system. Continue at your own risk.
  20. 4) Install the library into your Maven repository:
  21. $ mvn install
  22. 5) If you do not use Maven to manage your own build, you can build a
  23. .jar file to use:
  24. $ mvn package
  25. The .jar will be placed in the "target" directory.
  26. Installation - Without Maven
  27. ============================
  28. If you would rather not install Maven to build the library, you may
  29. follow these instructions instead. Note that these instructions skip
  30. running unit tests.
  31. 1) Build the C++ code, or obtain a binary distribution of protoc. If
  32. you install a binary distribution, make sure that it is the same
  33. version as this package. If in doubt, run:
  34. $ protoc --version
  35. If you built the C++ code without installing, the compiler binary
  36. should be located in ../src.
  37. 2) Invoke protoc to build DescriptorProtos.java:
  38. $ protoc --java_out=src/main/java -I../src \
  39. ../src/google/protobuf/descriptor.proto
  40. 3) Compile the code in src/main/java using whatever means you prefer.
  41. 4) Install the classes wherever you prefer.
  42. Usage
  43. =====
  44. The complete documentation for Protocol Buffers is available via the
  45. web at:
  46. http://code.google.com/apis/protocolbuffers/