Getting Started

Contents

Obtaining Gen2J
System and software requirements
Installation
Environment variables
Command path
Running Gen2J

Obtaining Gen2J

Gen2J can be downloaded from www.gen2j.org

System and software requirements

Recommended minimum system requirements

  • Pentium III 500Mhz or better
  • 256Mb main memory
  • 50Mb free disk space for model and generated files

Software required to use Gen2J

Installation

Unpack the distribution file in a suitable directory. This will create a new directory Gen2j below the directory where the distribution is unpacked.

Copy the ant.properties file in the etc directory under your Gen2J installation directory to your home directory or another suitable location. Edit the properties in it to set the correct locations of each package on your system, including Gen2J itself.

Environment variables

Set GEN2J_PROPS to the full pathname of the top-level ant.properties file which you edited above. For example, if you placed ant.properties in the directory C:\home\fred, you would set GEN2J_PROPS to C:\home\fred\ant.properties.

Command path

The instructions in Running Gen2J assume that the Apache Ant ant command is on the system command path.

Running Gen2J

You may wish to try running Gen2J on one of the supplied samples if you do not yet have a UML model to use as input.

Basic steps to creating an application with Gen2J

  1. Create a project directory. This is referred to below as project_dir.
  2. Create a UML model, as described in the “Creating the UML Model” section.
  3. Save or export the model in XMI format into project_dir. It is easiest to name the file after the project directory eg project_dir.xml

    If your exported XMI file refers to a DTD in the DOCTYPE instruction, ensure that the DTD file is present in the correct location. With the MagicDraw XMI export, the file uml.dtd supplied with the MagicDraw installation must be copied to the same directory as the XMI file.

  4. Copy the build.xml file from the etc directory under your Gen2J installation directory to project_dir
  5. Edit the build.xml file to set the project name in the name attribute of the project element. If you have not set the GEN2J_PROPS environment variable as described in the “Installation” section, you must also edit the value of the gen2j.properties property.
  6. Run Ant. The system generation and build may take several minutes. The result should be a file named <project_name>.ear in project_dir.
  7. Deploy the EAR file in your application server using the tools provided with the server, such as deploytool for the Sun J2SDKEE.