.ice documents translated into .java file

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/Wu_Kunbo/article/details/90756489

In the new free directory file code follows 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);
};

    };
  };
};

To compile the ice file, you need to install the ice, and the bin to the environment variable


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

Ice in the directory file, run the command> slice2java test.ice. It will generate java files in the original directory

Here Insert Picture Description

Guess you like

Origin blog.csdn.net/Wu_Kunbo/article/details/90756489