Browse Source

Add classpath for java example Makefile

king6cong 8 years ago
parent
commit
547d76ed8e
2 changed files with 8 additions and 1 deletions
  1. 1 1
      examples/Makefile
  2. 7 0
      examples/README.txt

+ 1 - 1
examples/Makefile

@@ -51,7 +51,7 @@ list_people_gotest: list_people.go list_people_go
 	go test list_people.go list_people_test.go
 	go test list_people.go list_people_test.go
 
 
 javac_middleman: AddPerson.java ListPeople.java protoc_middleman
 javac_middleman: AddPerson.java ListPeople.java protoc_middleman
-	javac AddPerson.java ListPeople.java com/example/tutorial/AddressBookProtos.java
+	javac -cp ../java/core/target/*.jar AddPerson.java ListPeople.java com/example/tutorial/AddressBookProtos.java
 	@touch javac_middleman
 	@touch javac_middleman
 
 
 add_person_java: javac_middleman
 add_person_java: javac_middleman

+ 7 - 0
examples/README.txt

@@ -28,6 +28,13 @@ These examples are part of the Protocol Buffers tutorial, located at:
 "-lpthread" from the linker commands (perhaps replacing it with something else).
 "-lpthread" from the linker commands (perhaps replacing it with something else).
 We didn't do this automatically because we wanted to keep the example simple.
 We didn't do this automatically because we wanted to keep the example simple.
 
 
+## Java ##
+
+protobuf-java-*.jar can be generated by:
+  cd ../java
+  mvn package
+and will be used by "make java"
+
 ## Go ##
 ## Go ##
 
 
 The Go example requires a plugin to the protocol buffer compiler, so it is not
 The Go example requires a plugin to the protocol buffer compiler, so it is not