Friday 24 July 2009

Adding external Java libraries to new KNIME plugins

Sorry, it is a blunt copy-paste plagiarism, but I needed to keep it written somewhere. Here it goes:

In order to add external jars to new KNIME plugins you need to: 

  1. Create a lib directory in your KNIME plugin.
  2. Copy the file(s) into the lib directory. (Java libraries are packed either as a zip or jar archive.)
  3. Edit the META-INF/MANIFEST.MF file with the "Plug-in Manifest Editor".
  4. Go to the "Runtime" tab and add all necessary libraries to the "Classpath" list on the bottom-right corner using the "Add..." button.
  5. Go the to "Build" tab and add the files to the list contained in the section "Extra classpath entries".
  6. Make sure that the lib directory is selected in both the "Binary Build" and "Source Build" list (in the same tab).

Finally note that adding jar files to the plugins build path, i.e. project context menu -> "Java Build Path" ->"Libraries" is not necessary.

No comments:

Post a Comment