无法编译gRPC java

时间:2017-07-02 11:50:18

标签: grpc-java

当我尝试编译gRPC for java

时,我收到以下错误

我正在运行的命令是gradlew.bat installDist

Execution failed for task ':grpc-compiler:compileJava_pluginExecutableJava_pluginCpp'.
> No tool chain is available to build for platform 'x86_64':
    - Tool chain 'visualCpp' (Visual Studio): Could not locate a Visual Studio installation, using the Windows registry and system path.
    - Tool chain 'gcc' (GNU GCC): Could not find C compiler 'gcc' in system path.
    - Tool chain 'clang' (Clang): Could not find C compiler 'clang' in system path.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

我已将Microsoft Visual Studio文件夹(C:\ Program Files(x86)\ Microsoft Visual Studio 14.0)添加到路径

更新

我已经安装了gcc和clang,但我仍然遇到上述错误

enter image description here

2 个答案:

答案 0 :(得分:0)

我刚刚遇到了同样的问题,并且我已经滑了一步,改为示例目录,它会起作用。

$ # Clone the repository at the latest release to get the example code:
$ git clone -b v1.8.0 https://github.com/grpc/grpc-java
$ # Navigate to the Java examples:
$ cd grpc-java/examples

**Run a gRPC application**

1. Compile the server    
$ ./gradlew installDist

2. Run the server
$ ./build/install/examples/bin/hello-world-server

3. In another terminal, compile and run the client
$ cd android/helloworld
$ ./gradlew installDebug

Congratulations! You’ve just run a client-server application with gRPC.

https://grpc.io/docs/quickstart/android.html#run-a-grpc-application

答案 1 :(得分:0)

即使我遇到了同样的问题。克隆代码时,代码库将是最新的母版。而且主代码有时会不稳定。但是在提到的Googlegroup之一中,检出v1.7.0并尝试了,它对我有用。 git checkout v1.7.0,