From dd3b54d639193cfcc89cc55a1eff9c967c400dfc Mon Sep 17 00:00:00 2001 From: Lisa Carey Date: Thu, 26 Feb 2015 14:53:08 +0000 Subject: [PATCH] updated with new example code location and build --- java/README.md | 38 ++++++++++++++------------------------ 1 file changed, 14 insertions(+), 24 deletions(-) diff --git a/java/README.md b/java/README.md index 4c5e4c5902b..9dbe6786336 100644 --- a/java/README.md +++ b/java/README.md @@ -1,17 +1,13 @@ gRPC in 3 minutes (Java) ======================== -BACKGROUND -------------- -For this sample, we've already generated the server and client stubs from [helloworld.proto](https://github.com/grpc/grpc-common/blob/master/protos/helloworld.proto). - PREREQUISITES ------------- - [Java 8](http://docs.oracle.com/javase/8/docs/technotes/guides/install/install_overview.html) - [Maven 3.2 or later](http://maven.apache.org/download.cgi). - - this is needed to install Netty5, a dependency of gRPC, and to build this sample + - this is needed to install Netty5, a dependency of gRPC INSTALL ------- @@ -29,30 +25,24 @@ $ cd grpc-java $ # follow the instructions in 'How to Build' ``` -3 Clone this repo, if you've not already done so. -```sh -$ cd -$ git clone https://github.com/grpc/grpc-common -$ cd grpc-common/java # switch to this directory -``` - -4 Build the samples -```sh -$ # from this directory -$ mvn package -``` - TRY IT! ------- -- Run the server +Our [Gradle build file](https://github.com/grpc/grpc-java/blob/master/examples/build.gradle) simplifies building and running the examples. + +You can build and run the Hello World server used in [Getting started](https://github.com/grpc/grpc-common) from the `grpc-java` root folder with: + ```sh -$ # from this directory -$ ./run_greeter_server.sh & +$ ./gradlew :grpc-examples:helloWorldServer ``` -- Run the client +and in another terminal window confirm that it receives a message. + ```sh -$ # from this directory -$ ./run_greeter_client.sh +$ ./gradlew :grpc-examples:helloWorldClient ``` + +TUTORIAL +-------- + +You can find a more detailed tutorial in [gRPC Basics: Java](https://github.com/grpc/grpc-common/blob/master/java/javatutorial.md).