[英]How can I compile an Apache Thrift definition file?
我正在嘗試編譯Apache Thrift定義文件(在Ubuntu上)。 我不斷收到錯誤消息: Could not open input file with realpath: Calculator.thrift
每當我將thrift -r --gen java Calculator.thrift
輸入命令行時。 我已經安裝了Thrift。 我應該在哪里保存.thrift定義文件,以便可以編譯它們?
在thrift安裝附帶的tutorial目錄中,您應該看到以下2 *.thrift
文件:
shared.thrift
tutorial.thrift
從這個相同的目錄,您應該能夠從thrift IDL文件生成/編譯,如下所示:
thrift -r --gen java ./tutorial.thrift
這應該在tutorial目錄中創建gen-java
子目錄。
Calculator.thrift
文件實際上不存在,Calculator服務在tutorial.thrift
定義。 該錯誤試圖告訴你它無法找到該文件,這是正確的,因為它實際上並不存在:)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.