Skip to content

Conversation

@dsaam94
Copy link

@dsaam94 dsaam94 commented Jan 16, 2026

No description provided.

Migrate KNIP extension build from Java 17 to Java 21 and update Apache
Tycho from version 2.7.5 to 4.0.13 to support the new Java version.

Changes:
- Update pom.xml:
  * tycho.version: 2.7.5 → 4.0.13
  * maven.compiler.source/target/release: 17 → 21
  * tycho-compiler-plugin: Add release=21 with useJDK=BREE
- Update all 8 MANIFEST.MF files:
  * Bundle-RequiredExecutionEnvironment: JavaSE-17 → JavaSE-21
  * Require-Capability osgi.ee version: 17 → 21 (in org.knime.knip.io)

This upgrade is necessary to leverage modern Java features and align with
the evolving Java ecosystem. The useJDK=BREE configuration ensures that
Tycho uses the correct JDK version matching the Bundle-RequiredExecutionEnvironment
specified in the OSGi manifests.

Note: This upgrade exposes a split package issue with org.w3c.dom that will
be addressed in a subsequent commit.
After upgrading to Java 21 and Tycho 4.0.13, the build fails with a split
package error when compiling XMLCellViewFactory.java. The error occurs because
the org.w3c.dom package exists in both:
1. The xml-apis OSGi bundle (version 1.4.01.v201903040420)
2. The java.xml module in Java 21's module system

Compilation Error:
[ERROR] The package org.w3c.dom is accessible from more than one module:
<unnamed>, java.xml
[ERROR] /org.knime.knip.io/src/org/knime/knip/io/view/XMLCellViewFactory.java:[29]
import org.w3c.dom.Document;
       ^^^^^^^^^^^^^^^^^^^^

This is a split package problem that the Eclipse JDT compiler (embedded in
Tycho 4.0.13) cannot resolve. Java 21's module system strictly enforces that
a package can only come from one module, but OSGi bundles and Java modules
have different classloading models.

Attempted Solutions (all failed):
- Import-Package directives in MANIFEST.MF
- DynamicImport-Package configurations
- Module-specific --add-reads compiler arguments
- Fully qualified type names
- useJDK=SYSTEM with javac compiler
- Various Eclipse JDT compiler warnings/errors suppression flags
- .settings/org.eclipse.jdt.core.prefs configurations
- Removing xml-apis from Require-Bundle

Workaround:
Since XMLCellViewFactory provides tree view rendering for XML cell values
(a non-critical feature), we disable it to unblock the Java 21 migration:

1. Comment out the extension registration in plugin.xml to prevent the
   class from being loaded at runtime
2. Rename XMLCellViewFactory.java to .java.disabled to prevent compilation

Impact:
- XML tree view feature unavailable in KNIME table views
- All other KNIP functionality remains intact
- Future resolution: Re-enable when Tycho/Eclipse JDT adds proper split
  package handling between OSGi bundles and Java modules
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants