Adding Java code dependencies

When you write your Java code for a JavaCompute node, you can include references to other Java projects and JAR files.

Before you start

To complete this task, you must have completed the following tasks:

The Java code in a JavaCompute node might contain references to other Java projects in your Eclipse workspace (internal dependencies), or to external JAR files, for example the JavaMail API (external dependencies). If other JAR files are referenced, you must add the files to the project class path.

  1. Right-click the project folder of the project that you are working on and click Properties.
  2. Click Java Build Path on the left pane.
  3. Click the Libraries tab.
  4. Perform one of the following steps:
    • To add an internal dependency, click Add JARs, select the JAR file that you want to add, then click OK.
    • To add an external dependency, click Add External JARs, select the JAR file that you want to add, then click Open. Copy the file to WorkPath/shared-classes where WorkPath is the full path to the working directory of the broker. If you do not copy the external dependencies here ClassNotFoundException exceptions are generated at run time.
    Tip:

    The default value for WorkPath depends on your operating system:

    Start of change
    • On Linux® and UNIX® systems, /var/mqsi/common/profiles
    • On Windows®, %ALLUSERSPROFILE%\Application Data\IBM\MQSI\common\profiles where the default setting for the environment variable %ALLUSERSPROFILE% is C:\Documents and Settings\All Users. The actual value might be different on your computer.
    End of change

You have now added a code dependency.

Related tasks
Managing Java Files
Writing Java
Changing the location of the work path
Related reference
JavaCompute node
Notices | Trademarks | Downloads | Library | Support | Feedback

Copyright IBM Corporation 1999, 2009Copyright IBM Corporation 1999, 2009.
Last updated : 2009-01-07 15:20:37

ac30280_