Generating Java code into a project

If you are generating a Java™ program or wrapper, it is recommended, and in some cases required, that you set the genProject build descriptor option. This generates output into a project in your workspace.

EGL provides various services for you when you generate into a project. The services vary by project type, as do your next tasks. See the sections below to find the particular type of project you want to use. Each section has the steps you will need to follow to generate into that type of project.

Application client project

When you generate into an application client project, EGL provides preparation-time access to the EGL JAR file (fda7.jar) by adding the following files to the project's Java build path:
  EGL_GENERATORS_PLUGINDIR/fda7.jar
EGL also provides runtime access to the EGL JAR files by importing them into each enterprise application project that references the application client project. EGL then updates the manifest in the application client project, so that the JAR files in an application client project are available. EGL also puts runtime values into the J2EE deployment descriptor. This is so you can avoid cutting and pasting entries from a generated J2EE environment file.
To generate Java into this type of project, do the following:
  1. If you are calling the generated program by way of TCP/IP, provide runtime access to a listener. This is described in Setting up a TCP/IP listener for J2EE called applications and Setting up the TCP/IP listener for a called non-J2EE application.
  2. Provide access to non-EGL JAR files, as described in the topic "Providing access to non-EGL JAR files".
  3. Once you have placed output files in a project, continue setting up the J2EE runtime environment.

J2EE web project

When you generate into an application client project, EGL provides preparation-time access to the EGL JAR file (fda7.jar) by adding them into the project's Web Content/WEB-INF/lib folder. EGL also puts runtime values into the J2EE deployment descriptor. This is so you can avoid cutting and pasting entries from a generated J2EE environment file.

To generate Java into this type of project, do the following:
  1. Provide access to non-EGL JAR files, as detailed in Providing access to non-EGL JAR files.
  2. Generate the code.
  3. Once you have placed output files in a project, continue as described in the topic Setting up the JEE runtime environment for EGL-generated code.

Java project

When you generate into a non-J2EE Java project for debugging or production purposes, EGL provides preparation-time access to the EGL JAR file (fda7.jar) by adding the following files to the project's Java build path:
  EGL_GENERATORS_PLUGINDIR/fda7.jar
 
EGL will generate a properties file under the following conditions:
  • genProperties is set to GLOBAL or PROGRAM; and
  • J2EE is set to NO.
If you set genProperties to GLOBAL (rununit.properties), EGL places that file in the Java source folder (the folder that contains the Java packages). The Java source folder may be either a folder within the project or the project itself. If you set genProperties to PROGRAM instead, EGL places the program properties file into the folder that contains the program.
To generate Java into this type of project, do the following:
  1. If your program accesses a relational database, make sure that your Java build path includes the directory where the driver is installed. For DB2®, for example, specify the directory that contains db2java.zip.
  2. If your code accesses WebSphere® MQ message queues, provide access to non-EGL jar files, as detailed in Providing access to non-EGL JAR files.
  3. Place a linkage properties file in the module.

Feedback