Compiling a Java user-defined node

Before you start

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

You can compile a Java user-defined node either from the command line, or from within the project itself. This topic outlines both options.

When you compile a Java user-defined node from the command line on any platform, you need the IBM Software Developer Kit for Java, Version 1.4.2.

Compiling a Java user-defined node from the workbench

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

  1. Switch to the Java Development Perspective, if it is not already active.
  2. In the Package Explorer, select the /src directory inside your node project, and click File > Export….
  3. From the list displayed, select JAR file. Click Next.
  4. The resources that are available for you to export as a JAR file are listed.
  5. Verify that Export generated class files and resources is checked.
  6. Specify a name and location for your JAR file. You should 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).
  7. You can use the default values for the rest of the options. Click Finish.
The created .jar file appears in your node project. The .jar file is then ready for you to install in a broker domain (see Installing a user-defined extension on a broker domain) or to package for distribution (see Distributing a user-defined extension).

Compiling a Java user-defined node from the command line

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

  1. Add the location of jplugin2.jar to the CLASSPATH. The location of the jplugin2.jar file for each platform is shown below:

    On Windows: install_dir\classes\jplugin2.jar

    On Linux: install_dir/classes/jplugin2.jar

    On UNIX: install_dir/classes/jplugin2.jar

    On z/OS: install_dir/classes/jplugin2.jar

  2. Start of changePut your Java user-defined node class into the following directory:

    install_dir\sample\extensions\nodes

    install_dir/sample/extensions/nodes

    install_dir/sample/extensions/nodes

    install_dir/sample/extensions/nodes

    End of change
  3. Start of changeChange to the directory that now contains your user-defined node class.End of change
  4. Start of changeCompile the .java file using the javac command, for example:
    javac nodename.java
    End of change
  5. Package the resulting .class file into a .par file. See Packaging a Java user-defined node.

The .par file you have created is then ready for you to install on a broker domain (see Installing a user-defined extension on a broker domain) or to package for distribution (see Distributing a user-defined extension).

Related information
Java user-defined node API