windows 和linux 下 thrift的安装和生成

1 download
http://thrift.apache.org/download/

2 example 文件
struct UserProfile {
        1: i32 uid,
        2: string name,
        3: string blurb
      }
      service UserStorage {
        void store(1: UserProfile user),
        UserProfile retrieve(1: i32 uid)
      }
保存为  example.thrift文件

3、生成 java文件
命令格式:
thrift --gen <language> <Thrift filename>
thrift-0.9.1.exe --gen java example.thrift

3 linux下
tar -zxvf thrift-0.9.1.tar.gz

pwd
ls
cat README
ls
./configure
make
sudo make install
thrift -version
history


猜你喜欢

转载自wangqiaowqo.iteye.com/blog/1938073