WebSphere Message Brokers
File: as10002_
Writer: Lorraine Waitt

Task topic

This build: July 31, 2007 21:38:30

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 start

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 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 in the workbench. Both options are described below.

When you compile a Java user-defined node from the command line on any platform, you need a compatible IBM Software Developer Kit for Java. For details of supported Java versions, see Additional software requirements.

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. The resources that are available for you to export as a JAR file are listed.
  4. Verify that Export generated class files and resources is checked.
  5. 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).
  6. You can use the default values for the rest of the options. Click Finish.
The created .jar file appears in your node project, and is ready for you to install in a broker domain (see Installing user-defined extension runtime files on a broker) or to package for distribution (see Packaging a user-defined node workbench project).

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:

    Windows platform On Windows: install_dir\classes\jplugin2.jar

    Linux platform On Linux: install_dir/classes/jplugin2.jar

    UNIX platform On UNIX: install_dir/classes/jplugin2.jar

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

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

    Windows platform install_dir\sample\extensions\nodes

    Linux platform install_dir/sample/extensions/nodes

    UNIX platform install_dir/sample/extensions/nodes

    z/OS platform install_dir/sample/extensions/nodes

  3. Change to the directory that now contains your user-defined node class.
  4. Compile the .java file 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.

The .par file that you have created is ready for you to install on a broker domain (see Installing user-defined extension runtime files on a broker) or to package for distribution (see Packaging a user-defined node workbench project).

Notices | Trademarks | Downloads | Library | Support | Feedback

Copyright IBM Corporation 1999, 2007Copyright IBM Corporation 1999, 2007. All Rights Reserved.
This build: July 31, 2007 21:38:30

as10002_ This topic's URL is: