1# Protocol Buffers - Google's data interchange format 2 3Copyright 2008 Google Inc. 4 5https://developers.google.com/protocol-buffers/ 6 7## Use Protobuf Java Lite Runtime 8 9Protobuf Java Lite runtime is separated from the main Java runtime because 10it's designed/implemented with different constraints. In particular, Java 11Lite runtime has a much smaller code size which makes it more suitable to 12be used on Android. 13 14Note that in order to achieve maximum performance and code size, we will 15NOT guarantee API/ABI stability for Java Lite. If this is not acceptable 16for your use-case, please use the full Java runtime instead. Note that 17the latest version of Java Lite is not compatible with the 3.0.0 version. 18 19You can generate Java Lite code for your .proto files: 20 21 $ protoc --java_out=lite:${OUTPUT_DIR} path/to/your/proto/file 22 23Note that "optimize_for = LITE_RUNTIME" option in proto file is deprecated 24and will not have any effect any more. 25 26Include the generated Java files in your project and add a dependency on the 27protobuf Java runtime. If you are using Maven, use the following: 28 29```xml 30<dependency> 31 <groupId>com.google.protobuf</groupId> 32 <artifactId>protobuf-javalite</artifactId> 33 <version>3.8.0</version> 34</dependency> 35``` 36 37For the older version of Java Lite (v3.0.0), please refer to: 38 39 https://github.com/protocolbuffers/protobuf/blob/javalite/java/lite.md 40