ubuntu 下安装调试 thrift
http://thrift.apache.org/download/
下载thrift的最新版本,然后解压,安装
tar -xzvf thrift-0.7.0.tar.gzchmod +x configure./configure./makemake install
但是thrift的安装编译,还需要依赖一些安装包,因此执行上述命令可能尚无法安装,需要等依赖包安装好后,进入解压后的thrift目录,重新执行配置和编译过程
依赖包如下或者参考http://wiki.apache.org/thrift/ThriftRequirements
GNU build tools: autoconf 2.59+ (2.60+ recommended), automake 1.9+, libtool 1.5.24+boost 1.34.0+g++ 3.3.5+pkgconfig (Use MacPorts for Mac OS X)lex and yacc (developed primarily with flex and bison)
执行如下命令,安装依赖包
sudo apt-get install build-essentialsudo apt-get install bison flexsudo apt-get install libboost-dev python-devsudo apt-get install autoconf automake libtool pkg-configsudo apt-get install git
至此,thrift已经安装完成,根据tutorial,可以快速的调试一个测试例子
进入thrift/tutorial目录,执行 thrift -r --gen java tutorial.thrift,生成thrift的java服务代码(client、server)
进入thrift/tutorial/java目录,执行ant,编译发布java代码
sh JavaServer //启动服务器端
sh JavaClient //启动客户端