1
protoc -I . --java_out=. --plugin=protoc-gen-java_plugin=../../../grpc-java/compiler/build/binaries/java_pluginExecutable/java_plugin account.proto

I use this command to compile proto files, but is only generate "AccountOuterClass" file, Don't have "AccountGrpc" file , I don't know why, please help me fix it.

1 Answer 1

1

You need to specify --java_plugin_out=.. --plugin tells protoc where to find the plugin, but it doesn't cause protoc to run the plugin; the _out argument does that.

Note that --java_out is not for javanano. You would want to use --javanano_out instead. To enable javanano for gRPC, you should add nano=true to java_plugin_out: --java_plugin_out=nano=true:.

Also note that the plugin is no longer named "java_plugin" but instead "protoc-gen-grpc-java", so you may need to make sure the --plugin argument points to an executable file.

Take a look at the compiler documentation for more info.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.