Cannot access classes from org.knime.core bundle in Java Snippet node

I may be able to help with that… I have a component… :wink:

I already had this component to go try to find bundles to get round the problem of things changing every time there was a new KNIME update, and based on your comments above, I’ve added the option to search subfolders of the bundles for required jars.

It should work the same way with both Java Snippet and Java Edit Variable…

As you can see from the screenshot, when the additional libraries has been specified using the flow variable, the syntax highlighter of the java editor does not recognise that the package is present. However, as you can also see from the node state and the output, it does actually compile and execute , returning the output “(WFM) ROOT (IDLE)” in this case as a flow variable.

So, possibly for editing the java, you’d want to add the required additional library in manually, but then for “shipping”, you could add it in using the flow variable from the “Collect Required Plugin Jars” component.

In the component you specify a file name pattern for it to search, so this kind of becomes an “abstraction layer” instead of being tied to a physical version number.

I have this component in my “experimental” folder on the hub, but its available to try, and happy to get feedback and suggestions if it is helpful.

(background/origin of this component)

5 Likes