knopflerfish / knopflerfish.org

Knopflerfish OSGi Service Platform. OSGi run-time container and SDK source code repo
http://www.knopflerfish.org
BSD 3-Clause "New" or "Revised" License
33 stars 11 forks source link

Compiling KF with JDK 11 #50

Open chlarsson opened 5 years ago

chlarsson commented 5 years ago

Compiling KF (in develop) with JDK11 fails due to ASM issues.

New version of asm is required, e.g. asm >= 7

d3bjorn commented 2 years ago

This is fixed. asm.version has been changed to 9.3

d3bjorn commented 2 years ago

There seems to be some new errors in osgi_tck when running that with JDK11.

d3bjorn commented 2 years ago

One problem is the class loader check done in FWProps in order to set org.osgi.supports.framework.extension. This test assumes that the class loader is instanceof URLClassLoader. With JDK8 we have a sun.misc.Launcher.AppClassLoader, which extends java.net.URLClassLoader (which extends java.security.SecureClassLoader). With JDK11 we have a jdk.internal.loader.ClassLoaders.AppClassLoader, which extends jdk.internal.loader.BuiltinClassLoader (which extends java.security.SecureClassLoader). This causes org.osgi.supports.framework.extension to be set to false, which is not allowed for OSGi R4 and later.

If we force org.osgi.supports.framework.extension to be true, we get NoClassDefFoundError from some tests that depend on org/osgi/test/cases/condpermadmin/testcond/TestPostPonedCondition or org.osgi.test.cases.condpermadmin.testcond.TestCondition.

d3bjorn commented 2 years ago

Another problem is that org.osgi.test.cases.framework.junit.classloading.ClassLoadingTests.testHiddenPackages001 depends on org.omg.CORBA which is not present in JDK11.