I used the Windows version of both the JDK 1.2 and the Java IDL compiler. Of course, given Java's platform independence, that shouldn't matter to you. Use whichever JDK 1.2 development environment you prefer.
As with the TAO IDL compiler, we use the Java IDL compiler, idltojava.exe, to generate the stub and skeleton classes necessary for our Java client and server, respectively. Assuming idltojava.exe resides in our PATH, we can do something like this:
> idltojava Hello.idlUnlike tao_idl, idltojava.exe may not create the same number of source files for every IDL file it compiles. This is due to Java's file naming convention: for any class, SomeClass, it must be contained in a file named SomeClass.java. So the number of files generated by idltojava depends on the number of interfaces and datatypes defined in the IDL file. And remember how IDL modules map to C++ namespaces? (Did I mention that?) Well, in Java, an IDL module corresponds to a Java package, and since Java packages are represented as directories on your disk, the Java IDL compiler will create a directory for each module declared in the IDL file. Our World interface isn't defined within a module, so the following files are created in the current directory:
Let's move on and write a Java server.
Back to... [ Corba Tutorials ]