Checkout Knopflerfish
Knopflerfish on GitHub
Follow knopflerfish on Twitter

Knopflerfish OSGi & Java Compatibility Guide

Knopflerfish as well as Java has evolved over the years and it is becoming more and more difficult to get an overview of what different version of Knopflerfish, OSGi specifications and Java actually work together. This page attempts to make this a bit more clear.

Knopflerfish Distribution Builds

The table below describes the different Knopflerfish distribution builds, what java run-time environments, they support, the Java / JDK version the Knopflerfish source code is compatible with, and which byte code version the source code is compiled into.

In general, the Knopflerfish distributions are always compiled into the least Java/JDK version the source code supports. This is to support the embedded market where many JVM:s are still on JDK1.6 level, or even older.

Since all code is upwards compatible Knopflerfish can easily be compiled into a more recent version of Java, including Java8. Please see the table later on this page presenting javac compatibility issues.

Knopflerfish Major Distribution Builds, OSGi and Java Version Guide
KF Version OSGi JDK Byte code Supported Java Run-times EE
7.* OSGi R7 1.8 52 1.8+ Deprecated1
6.* OSGi R6 1.6 50 1.6+, including Java 9 OSGi min 1.2
5.* OSGi R5 1.4 48 1.4+ (headless or AWT)
1.5+ (when using swing based bundles, e.g. desktop)
OSGi min 1.2
4.* OSGi R4 v4.3 1.4 48 1.4+ (headless or AWT)
1.5+ (when using swing based bundles, e.g. desktop)
OSGi min 1.2
3.* OSGi R4 v4.2 1.2 45 1.2+, PJava 1.2 (headless or AWT)
1.5+ (when using swing based bundles, e.g. desktop)
OSGi min 1.2

1 OSGi EE are deprecated in OSGi R7

A plus-sign after a Java version indicates it supports that version and higher.

Please also note that some of Knopflerfish utility bundles that are uses Swing, e.g. the desktop bundle, do require Java 1.5 or higher.

Building Knopflerfish

The table below describes the different Knopflerfish versions and which JDK versions can be used to build them.

KF7 will be designed to run on Java 1.8 and upwards. To run Knopflerfish on older versions of Java than 1.8 KF6 or earlier must be used.

KF6 is designed to run on Java 1.6 and upwards. To run Knopflerfish on older versions of Java KF5 or earlier must be used.

KF6 can be built using Java 1.6 or higher and the byte code generated will be made for the tool chain used. E.g. if building KF6 with Java 8 the bundles will be built for Java 8 by default.

The current released version of KF6 can not be built with JDK9. The next planned KF6 release will include support for building with JDK9.

KF5 and KF4 are both designed to run on Java 1.4 and upwards. With OSGi R4 v4.3 Java 5 generics were introduced in the OSGi APIs. To be able to build a KF distribution that is compatible JDK 1.4 the the javac flag -target jsr14 is used to remove generics. This has the drawback that such compiled .class files can not be used when building on JDK 1.7 since support for jsr14 has been removed in Java 7. To use Knopflerfish artifacts in a JDK 1.7 based tool chain KF5 must therefore be built using JDK 1.7. When building KF5 using JDK 1.7 the default is to generate Java byte code for JDK 1.5 and upwards which is compatible with a JDK 1.7 tool chain.

Knopflerfish Major Distribution Builds, javac and JDK Version Guide
KF Version OSGi KF Source Code Build Environment Generates byte code for Tool Chains1 Comment
7.* R7 1.8 1.8 JDK used 1.8 The default is to build for JDK used
11 JDK 11 (55) 11++ Planned support
6.* R6 1.6 1.6 JDK 1.6 (50) 1.6 - 1.8 The default is to build for JDK used
1.7 JDK 1.7 (51) 1.7+ The default is to build for JDK used
1.8 JDK 1.8 (52) 1.8+ The default is to build for JDK used
11 JDK 11 (55) 11++ Planned support
5.* R5 1.5 (1.6)2 1.5 - 1.6 JDK 1.4 (48) 1.4-1.6 KF build system default when using JDK 1.5 - 1.6. Generics removed during compilation by using -jsr14 flag
1.7+ JDK 1.5 (49) 1.5+ KF build system default when using JDK 1.7. Generics are not removed and therefore require Java 1.5 or higher
1.5 - 1.6 JDK 1.5 (49) 1.5+ Supported, but not out of the box. Requires setup changes in the KF build system for this build, e.g. modifying the -target flag
1.7+ JDK 1.7 (51) 1.7+ Supported, but not out of the box. Requires setup changes in the KF build system for this build, e.g. modifying the -target flag
4.* R4 v4.3 1.5 1.5 - 1.6 JDK 1.4 (48) 1.4 - 1.6 OSGi R4 v4.3 introduced generics in API classes. Generics are removed during compilation by using -jsr14 flag
3.* R4 v4.2 1.2 1.3+ JDK 1.2 (46) 1.2+

1 Indicates which version of the Java tool chain is needed to build third party code and using Knopflerfish bundle jars on the build path.

2 In KF5 JDK 1.6 annotations recognized by IDEs have been introduced. The source code still remain java 1.5 compatible.

Beyond Java 8 - Knopflerfish and Java versions 11 and 12

We have so far detected no major issues when running KF6 with a Java 11 or Java 12 run-time.

However the current released version of KF6 can not be built with JDK 11 or JDK 12. The develop branch includes several minor fixes that enable support for JDK 11 and JDK 12. A new KF6 release with support for JDK 11 can be expected in the near future.

Knopflerfish and Java LTS versions - Java 11

Knopflerfish intends to support all Java LTS versions, e.g. Java 11.

Intermediate java versions may be supported, eg, Java 12, but the focus of the support work will be on LTS versions.

Java 9 and 10

It should be possible to build KF6 with JDK 10 or 9. However, since these two versions are no longer officially supported, there will be no official knopflerfish support for them.