Lines Matching +full:build +full:- +full:java
1 # Protocol Buffers - Google's data interchange format
5 https://developers.google.com/protocol-buffers/
7 ## Use Java Protocol Buffers
9 To use protobuf in Java, first obtain the protocol compiler (a.k.a., protoc,
11 generate Java code for your .proto files:
13 $ protoc --java_out=${OUTPUT_DIR} path/to/your/proto/file
15 Include the generated Java files in your project and add a dependency on the
16 protobuf Java runtime.
25 <artifactId>protobuf-java</artifactId>
34 protobuf-java-util package:
39 <artifactId>protobuf-java-util</artifactId>
46 If you are using Gradle, add the following to your `build.gradle` file's dependencies:
48 implementation 'com.google.protobuf:protobuf-java:3.21.12'
52 ### Use Java Protocol Buffers on Android
54 For Android users, it's recommended to use protobuf Java Lite runtime because
55 of its smaller code size. Java Lite runtime also works better with Proguard
56 because it doesn't rely on Java reflection and is optimized to allow as much
57 code stripping as possible. You can following these [instructions to use Java
60 ### Use Java Protocol Buffers with Bazel
62 Bazel has native build rules to work with protobuf. For Java, you can use the
64 for Android. Check out [our build files examples](../examples/BUILD) to learn
67 ## Build from Source
69 Most users should follow the instructions above to use protobuf Java runtime.
72 below to build protobuf from source code.
74 ### Build from Source - With Maven
80 2) Build the C++ code, or obtain a binary distribution of protoc (see
85 $ protoc --version
101 5) If you do not use Maven to manage your own build, you can build a
110 * protobuf-java: The core Java Protocol Buffers library. Most users only
112 * protobuf-java-util: Utilities to work with protos. It contains JSON support
113 as well as utilities to work with proto3 well-known
116 ### Build from Source - Without Maven
118 If you would rather not install Maven to build the library, you may
123 1) Build the C++ code, or obtain a binary distribution of protoc. If
127 $ protoc --version
132 2) Invoke protoc to build DescriptorProtos.java:
134 $ protoc --java_out=core/src/main/java -I../src \
137 3) Compile the code in core/src/main/java using whatever means you prefer.
143 * Protobuf minor version releases are backwards-compatible. If your code
144 can build/run against the old version, it's expected to build/run against
149 * Protobuf major version releases may also be backwards-compatible with the
159 * Deprecated non-experimental APIs will be removed two years after the release
180 https://developers.google.com/protocol-buffers/