Compiling a Java user-defined node

When you have created the code for your Java™ user-defined node, you must compile it for your operating system.

Before you begin

You must have a user-defined node written in Java. This node can be one of the provided sample nodes that are described in Sample node files, or a node that you have created yourself by using the instructions in either Creating a message processing or output node in Java or Creating an input node in Java.

About this task

You can compile a Java user-defined node either from the command line, or from within the project in the IBM® Integration Toolkit. Both options are described later in this section.

When you compile a Java user-defined node from the command line, you must have a compatible IBM Software Developer Kit for Java on the current operating system. For details of supported Java versions, see the IBM Integration Bus system requirements; see IBM Integration Bus system requirements.

Compiling a Java user-defined node from the IBM Integration Toolkit

About this task

Use the following procedure to compile your Java user-defined node from the IBM Integration Toolkit:

Procedure

  1. Switch to the Java perspective, and in the Package Explorer, select the /src directory inside your node project, and click File > Export.
  2. From the list displayed, select JAR file. Click Next.
    The resources that are available for you to export as a JAR file are listed.
  3. Verify that Export generated class files and resources is selected.
  4. Specify a name and location for your JAR file.
    Place the file inside the root directory of your node project, and give the file the same name as the name of the project (with a .jar extension). You can use the default values for the rest of the options. Click Finish.

Results

The .jar file that you have created is displayed in your node project, and is ready for you to install on one or more integration nodes (see Installing user-defined extension runtime files on an integration node), or to package for distribution (see Packaging and distributing a user-defined node project).

Compiling a Java user-defined node from the command line

About this task

Use the following procedure to compile your Java user-defined node from the command line:

Procedure

  1. Add the location of jplugin2.jar to the CLASSPATH for your current platform:

    Windows platforminstall_dir\server\classes\jplugin2.jar

    Linux platformUNIX platformz/OS platforminstall_dir/server/classes/jplugin2.jar

  2. Put your Java user-defined node class into the following directory:

    Windows platforminstall_dir\server\sample\extensions\nodes

    Linux platformUNIX platformz/OS platforminstall_dir/server/sample/extensions/nodes

  3. Change to the directory that now contains your user-defined node class.
  4. Compile the .java file by using the javac command; for example:
    javac nodename.java
  5. Package the resulting .class file into a .par file. See Packaging a Java user-defined node.

Results

The .par file that you have created is ready for you to install on one or more integration nodes (see Installing user-defined extension runtime files on an integration node), or to package for distribution (see Packaging and distributing a user-defined node project).