grpc-java icon indicating copy to clipboard operation
grpc-java copied to clipboard

Run a grpc application not working

Open nagamanikandank opened this issue 10 years ago • 9 comments

According to link http://www.grpc.io/docs/quickstart/java.html#run-a-grpc-application , I must follow the below steps to execute a hello world sample client and server.

From the examples directory:
$ ./gradlew installDist
$ ./build/install/examples/bin/hello-world-server
$ ./build/install/examples/bin/hello-world-client

I am using Windows machine , so gradlew installDist command works for me. But after that, there is no build/install/examples/bin folder structure to execute hello-world-server.

There is a hello-world-server in examples\build\tmp folder, but that too gives following error Error: Could not find or load main class io.grpc.examples.helloworld.HelloWorldServer

Please help

nagamanikandank avatar Nov 02 '16 20:11 nagamanikandank

What directory did you run it from?

carl-mastrangelo avatar Nov 02 '16 20:11 carl-mastrangelo

I am running from examplesdirectory

nagamanikandank avatar Nov 02 '16 20:11 nagamanikandank

Are you running from master?

carl-mastrangelo avatar Nov 02 '16 22:11 carl-mastrangelo

There is no folder called master

nagamanikandank avatar Nov 02 '16 22:11 nagamanikandank

What I mean to say is, what version of gRPC are you using?

carl-mastrangelo avatar Nov 02 '16 22:11 carl-mastrangelo

I am in (v1.0.0) branch

nagamanikandank avatar Nov 02 '16 22:11 nagamanikandank

@carl-mastrangelo , any help pls

nagamanikandank avatar Nov 03 '16 17:11 nagamanikandank

I am not sure what is wrong. I am on linux, so the commands seem to work on my machine. As a sanity check could you verify the following things:

  1. Windows uses \ instead of /, could you replace the command with that, and remove the ./ at the beginning of the command?
  2. Could you run dir while in the the examples directory?
  3. Can you also include the full output of ./gradlew clean installDist ?

carl-mastrangelo avatar Nov 03 '16 18:11 carl-mastrangelo

I found the solution!!!!!!I had to run hello-world-client and hello-world-server from build/install/examples/bin/ folder and not hello-world-client.bat and hello-world-server.bat

nagamanikandank avatar Nov 03 '16 22:11 nagamanikandank