.ice文件编译成.java文件

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接: https://blog.csdn.net/Wu_Kunbo/article/details/90756489

在随意目录下新建test.ice文件 代码如下


module com{
module wkb{
module test{

["java:getset"]
struct student{
int sid;
string sname;
int sage;
};

sequence<student> studentList;

["java:getset"]
struct teacher{
int tid;
string tname;
int tage;
studentList students;
};

interface StudentI{
  //根据学生id查找学生姓名
  string queryStuNameById (int sid);
};

    };
  };
};

要编译这个ice文件,需要先安装ice,并且将bin加入到环境变量


系统变量
ICE_HOME = D:\Ice-3.6.3-win
Path = %ICE_HOME%\bin;

在ice文件所在目录下,运行命令>slice2java test.ice。就会在原来目录下生成java文件

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/Wu_Kunbo/article/details/90756489