javaprotocol-buffersgrpcgrpc-javaproto

Could not make proto path relative: java_out=C:\proto\: No such file or directory



I'm learning gRPC and this is my first app.
I'm using windows 10, java Graalvm 11.
my proto file
syntax = "proto3";

package example;

option java_package = "ir.farshad.services";
option java_multiple_files = true;


service EmployeeService{
    rpc getEmployee (EmployeeRequest) returns (EmployeeeResponse);
}

message EmployeeRequest{
    int64 id = 1;
}

message EmployeeeResponse{
    int64 id = 1;
    string name = 2;
    string designation = 3;
}

my run command

set PROTO_FOLDER_PATH=C:\proto\empoloyee
set PROTO_PLUGIN_PATH=C:\proto\protoc-gen-grpc-java-1.47.0-windows-x86_64.exe
set OUTPUT_DIR=C:\proto


protoc --proto_path=%PROTO_FOLDER_PATH% --plugin=protoc-gen-grpc-java=%PROTO_PLUGIN_PATH% --grpc-java_out=%OUTPUT_DIR% java_out=%OUTPUT_DIR%  %PROTO_FOLDER_PATH%\employee.proto

and I get this Error

Could not make proto path relative: java_out=C:\proto\: No such file or directory


my folder tree is

C:\PROTO
│   protoc-gen-grpc-java-1.47.0-windows-x86_64.exe
│
└───empoloyee
        employee.proto
        run.bat

thank you in advance


Solution

  • In the code snippet of the command, we see:

    java_out=%OUTPUT_DIR%
    

    It should be a flag:

    --java_out=%OUTPUT_DIR%