Java Call IDL Method summary
Java calls the IDL program, you need to load the IDL Java Package (Javaidlb.jar) in Java, the package does not need to download, in the IDL installation directory can be directly found (C:\Program files\exelis\idl82\resource\ Bridges\export\java\ Javaidlb.jar).
There are two ways in which Java calls IDL
First, start the interface class in Java and execute the IDL program directly, for example:
The executestring is filled in with IDL statements.
Second, the output of data visualization and analysis function of IDL IDL is called by the common Java class.
The first step: Write Pro files, for example:
It is important to note the format of the pro file, the struct structure is necessary, the class name before the function name (this example READHDF::) is also necessary, otherwise there will be problems in the next step.
When the pro file is saved, the file name is also in *_define.pro form
Part II: Exporting Java Classes
Enter Idlexbr_assistant carriage return in the Command Line window of IDL and eject the Export Bridge assitant window.
Select a previously saved pro file
Set the property on the right and build to get the Java file. The functions in the Java file do not have actual functionality (as shown), or the pro file is called, so we need to move the previous pro file to the IDL installation path: C:\Program files\exelis\idl82\lib\bridges
After a series of steps above, the preparation is ready and can be called in the Java Project as follows:
Private static readhdf RHDF;
Don't forget to CreateObject, or you will get an error.
Java Call IDL Method summary