java-11propertychangelistener

Java 11 - java/beans/PropertyChangeListener


Getting below with java11. This was working fine with java 8. Please suggest. This is happening only when running in eclipse 4.12 Is there a way we can add module java.desktop when compliance level is 1.8 in eclipse.

java.lang.NoClassDefFoundError: java/beans/PropertyChangeListener
    at java.base/java.lang.ClassLoader.defineClass1(Native Method)
    at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
    at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
    at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:802)
    at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:700)
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:623)
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
    at com.my.cep.driver.http.server.impl.TomcatServer.init(TomcatServer.java:155)
    at com.my.cep.driver.http.MyChannel.init(MyChannel.java:78)

Solution

  • I got the resolution to above issue.

    Ad below in vm arguments to resolve.

    --add-modules java.xml,java.sql,java.prefs,java.desktop