CORBA---Jacorb的安装与编译

Jacorb安装配置

 

1、到http://www.jacorb.org/download.html下载合适的版本并解压到本地,

2、设置环境变量

      添加F:\jacorb-3.0\bin到path,并创建JACORB_HOME变量为F:\jacorb-3.0

3、修改idl.bat

     F:\jacorb-3.0\bin目录下会自带一个idl.bat.tpl的文件,该文件只是一个示例,需要重命名为idl.bat

    并修改文件内容。

    当然要确保有java环境和JAVA_HOME变量  

@echo off

"%JAVA_HOME%\bin\java" -classpath "%JACORB_HOME%\lib\idl.jar;%CLASSPATH%" org.jacorb.idl.parser %*

 

4、在命令行中执行idl -h,显示帮助信息,说明已配置完成。

C:\Documents and Settings\Administrator>idl -h
        -h|help         these few lines of help
        -v|version      print version information
        -d dir          root of directory tree for output
        -Dx             define preprocessor symbol x with value 1
        -Dx=y           define preprocessor symbol x with value y
        -Idir           set include path for idl files
        -U<symbol>              undefine preprocessor symbol
        -W [1..4]       debug level
        -all            generate code for all IDL files, even included ones
        -forceOverwrite generate code even if IDL has not changed
        -ami_callback           generate AMI reply handlers and sendc methods
        -ami_polling            generate AMI poller and sendp methods
        -backend classname              use classname as code generator
        -addbackend classname           add classname as code generator
        -i2jpackage x:a.b.c      replace IDL package name x by a.b.c in generate
d Java code (e.g. CORBA:org.omg.CORBA)
        -i2jpackagefile <filename>       replace IDL package names using list fr
om <filename>. Format as above.
        -ir             generate information required by the Interface Repositor
y
        -nofinal        generated Java code will contain no final class definiti
ons
        -unchecked_narrow               use unchecked_narrow in generated code f
or IOR parameters in operations
        -noskel         disables generation of POA skeletons
        -nostub         disables generation of client stubs
        -diistub                generate dii-based client stubs
        -cldc10         code generation compatible with J2ME/CLDC 1.0
        -sloppy_forward allow forward declarations wo. later definitions
        -sloppy_names   less strict checking of module name scoping
        -sloppy_identifiers     Allow certain illegal identifiers.
        -permissive_rmic        tolerate dubious IDL generated by JDK's rmic, in
cludes -sloppy_names.
        -genEnhanced    Generate toString and equals on stubs. Only supported on
 Struct currently.
        -generate_helper (portable[default]|jacorb|deprecated). Controls the con
trols the compatibilty level of the generated helper code.
        -cacheplugin classname  set plu gin for cache code generation
        -syntax         syntax check only, no code generation
        <filelist>

 

编译IDL文件

 

执行以下命令:

 

C:\Documents and Settings\Administrator>idl -all -d F:\project\corbaTest -in F:\project\corbaTest\*.*

 其中-d后的目录为生成代码的目录,-in后的目录为idl文件的所在目录

 

 

执行以下命令可以修改包名

 

C:\Documents and Settings\Administrator>idl -all -d F:\project\corbaTest -i2jpackagefile f:\format.txt -in F:\project\corbaTest\*.*

 

 

format.txt的内容

 

MyServer:com.cheng.MyServer

 

 至此,使用jacorb将idl编译成java代码已完成

 

 

 

 

 

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值