1. bin目录下 idl.bat的内容如下: @echo off rem @JAVA_CMD@ -classpath "@JACORB_HOME@/lib/idl.jar;@JACORB_HOME@/lib/logkit-1.2.jar;%CLASSPATH%" org.jacorb.idl.parser %* set JACORB_HOME=D:/jacorb set JAVA_HOME=C:/j2sdk1.4.2_13 set path=%JAVA_HOME%/bin;%path% set CLASSPATH=%JAVA_HOME%/lib/rt.jar set CLASSPATH=%JACORB_HOME%/lib/antlr-2.7.2.jar;%JACORB_HOME%/lib/avalon-framework-4.1.5.jar;%JACORB_HOME%/lib/concurrent-1.3.2.jar;%JACORB_HOME%/lib/idl.jar;%JACORB_HOME%/lib/jacorb.jar;%JACORB_HOME%/lib/logkit-1.2.jar;%JACORB_HOME%/lib/picocontainer-1.2-021105.jar;%JACORB_HOME%/lib/wrapper-3.1.0.jar;%JACORB_HOME%/classes;%CLASSPATH% %JAVA_HOME%/bin/java -cp %CLASSPATH% org.jacorb.idl.parser %* 2. 运行 D:/jacorb/bin>idl -h 可以看到帮助信息。 3. 常用的命令如下: D:/jacorb/bin>idl -d c:/ -i2jpackage :com.navyu D:/jacorb/demo/hello/server.idl -d 代表生成的java代码的目录。 -i2jpackage 增加java代码 中 package 的前缀。也就是在idl中的 module前缀。 -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) 编译整个目录: D:/jacorb/bin>idl -all -d c:/ -i2jpackage :com.navyu -in D:/jacorb/idl/*.* 功能更强大的: idl -d c:/ct -ID:/jacorb/idl/omg -i2jpackagefile c:/format.txt -all -in D:/jacorb/idl/*.* -Idir set include path for idl files 由于有时候需要omg定义的系统IDL,所有需要该参数。 -i2jpackagefile <filename> replace IDL package names using list fr om <filename>. Format as above. 支持更复杂的idl package names 替换。