首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > Rational >

rational rose生成Java代码的异常

2012-02-25 
rational rose生成Java代码的错误在网上找到了这样一段话,是用rose生成代码的。先在某一个或某几个classdia

rational rose生成Java代码的错误
在网上找到了这样一段话,是用rose生成代码的。
先在某一个或某几个class diagram中建好你要生成代码的所有class,右键单击Browser区域的Component View,新建一个Component,双击这个component,打开它的Specification对话框,选择Realizes属性页,会看到你刚才所建的所有的class,分别右击每一个class,在菜单里选“Assign”,这样就把这些class分配给了这个component。再选择General属性页,在Language右边的下拉框中选择ANSI C++或者其他合适的选项,点OK退出对话框。  
  这时,在右击这个component,会看到多了一个ANSI C++的菜单项,在它的二级菜单中选择Generate code,按照提示做既可!

照着做了,最后生成的时候提示错误:

15:38:04| ERROR: Component Component View::serverComponet - name of public class and compilation unit must match. To generate code, please rename the class to match the compilation unit or detach it from the compilation unit.
15:38:04| ERROR: Component Component View::serverComponet - a compilation unit can have at most one public class

不知道是什么原因。

[解决办法]

热点排行