Transformations > Java transformation > Compiling the code
  

Compiling the code

To validate a Java transformation, you must compile the Java code snippets that you enter in the Java editor. Data Integration uses the Secure Agent to compile the Java code snippets. Compile the code and view compilation results on the Java tab.
When you create a Java transformation, it contains a Java class that defines the base functionality for the transformation. When you compile the transformation, the Secure Agent adds the code that you enter in the Java editor to the template class for the transformation. This generates the full class code for the transformation.
The Secure Agent calls the JDK to compile the full class code. The JDK compiles the transformation and generates the byte code for the transformation.
Note: In a mapplet, the Java transformation compiles based on the data types and APIs that you can use in non-elastic mappings. If the code contains data types or APIs that you can use only in elastic mappings, such as the invokeJExpression API method, the code fails to compile.
Before you can compile the code, you must complete the following tasks:
  1. 1. If you use non-standard Java packages, configure the classpath.
  2. For more information about configuring the classpath, see Classpath configuration.
  3. 2. Select the runtime environment to use for compilation.
  4. Select the runtime environment on the Java tab. The Hosted Agent is not supported for compilation.
To compile the code, click Compile in the Java editor.
The compilation results shows the results of the compilation. Use the compilation results to identify and locate Java code errors.

Viewing the full class code

You can view and download the full class code that is generated when you compile a Java transformation. You can access the full class code from the Compilation Results on the Java tab.
To view the full class code, click View Full Code in the compilation results. Data Integration displays the full class code in the Full Code dialog box.
To download the full code, click Download Full Code in the Full Code dialog box.