参考官网http://thrift.apache.org/docs/install/centos
[root@hserver1 ~]# mkdir thrift-test
[root@hserver1 ~]# cd thrift-test/
[root@hserver1 thrift-test]# ls
[root@hserver1 thrift-test]# vi demo.thrift
[root@hserver1 thrift-test]# thrift --gen java demo.thrift
[root@hserver1 thrift-test]# ls
demo.thrift gen-java
[root@hserver1 thrift-test]# vi gen-java/com/imooc/thrift/demo/DemoService.java