I downloaded protobuf-2.5.0.tar.gz, extracted it, did the usual ./configure, make, make check, and make install. However, the file protobuf.jar which seems to be needed for using protocol buffers in Java does not seem to be part of what I downloaded. Worse, I cannot find this file anywhere. Please advise me how to proceed.
You can add it as a Maven dependency:
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>2.5.0</version>
</dependency>
All dependency information is available at Maven Central, or just download the .jar file directly.
To generate the protobuf.jar
file, you need to do what Bruce Martin suggests, but you then need to do the following:
src/main/java/com/google/protobuf
directorybin
.java
files: $ javac -d bin *.java
bin
directory, and finally, run the following command to generate the protobuf.jar
file: $ jar cvf protobuf.jar com/
Then, copy and paste the jar to wherever you need it.
You can download ProtoBuf Jar
from
Here
then you can put jar
inside libs
folder
and if want to get Protobuf
repository from maven
then
add inside pom.xml
file.
Hope it will help..
The simple solution is that you should compile the jar by yourself.
Here is what you should do in Linux
./configure
./make
You can install the protoc by run ./make install
Then you need the jar, let me assume you are on ubuntu
install maven first sudo apt-get install maven
Then follow the instruction in /java/README.txt
If you want the standard jar
mvn package
If you want the lite version
mvn package -P lite
Then you can find the jar in /java/target
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With