JxBrowser Java, Gradle issue

254 views Asked by At

When loading my jxBrowser app built in java, using javafx, and using Gradle.

I get this error:

Exception in thread "JavaFX Application Thread" java.lang.IllegalAccessError: class com.teamdev.jxbrowser.view.javafx.internal.java9.platform.PlatformImplMac (in module jxbrowser.javafx) cannot access class com.sun.glass.ui.Window (in module javafx.graphics) because module javafx.graphics does not export com.sun.glass.ui to module jxbrowser.javafx
at [email protected]/com.teamdev.jxbrowser.view.javafx.internal.java9.platform.PlatformImplMac.findNativeHandle(PlatformImplMac.java:25)
at [email protected]/com.teamdev.jxbrowser.view.javafx.internal.Platform.doFindNativeHandle(Platform.java:154)
at [email protected]/com.teamdev.jxbrowser.view.javafx.internal.Platform.nativeHandle(Platform.java:131)
at [email protected]/com.teamdev.jxbrowser.view.javafx.internal.OffScreenRenderWidget.show(OffScreenRenderWidget.java:303)
at [email protected]/com.teamdev.jxbrowser.view.javafx.internal.IoSurfaceRenderWidget.show(IoSurfaceRenderWidget.java:88)
at [email protected]/com.teamdev.jxbrowser.view.javafx.internal.OffScreenRenderWidget.setWindow(OffScreenRenderWidget.java:224)
at [email protected]/com.teamdev.jxbrowser.view.javafx.internal.OffScreenRenderWidget.access$2000(OffScreenRenderWidget.java:73)
at [email protected]/com.teamdev.jxbrowser.view.javafx.internal.OffScreenRenderWidget$SceneChangeListener.setScene(OffScreenRenderWidget.java:586)
at [email protected]/com.teamdev.jxbrowser.view.javafx.internal.OffScreenRenderWidget$SceneChangeListener.lambda$changed$0(OffScreenRenderWidget.java:575)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)

I don't believe I am missing anything.

I have added all nessasary items in my build.gradle:

repositories {
    // The repository for JxBrowser binaries.
    maven { url = 'https://us-maven.pkg.dev/jxbrowser/releases' }
}

ext {
    junitVersion = '5.7.1'
    jxBrowserVersion = '7.15'
}

dependencies {

    ...
    implementation "com.teamdev.jxbrowser:jxbrowser-win64:${jxBrowserVersion}"
    implementation "com.teamdev.jxbrowser:jxbrowser-mac:${jxBrowserVersion}"
    implementation "com.teamdev.jxbrowser:jxbrowser-javafx:${jxBrowserVersion}"
}

I have the VM options needed:

applicationDefaultJvmArgs = [
        "--add-exports", "javafx.controls/com.sun.javafx.scene.control=ALL-UNNAMED",
        "--add-exports", "javafx.graphics/com.sun.javafx.stage=ALL-UNNAMED",
        "--add-exports", "javafx.graphics/com.sun.javafx.scene=ALL-UNNAMED",
        "--add-exports", "javafx.graphics/com.sun.javafx.scene.traversal=ALL-UNNAMED",
        "--add-exports", "javafx.graphics/com.sun.javafx.tk=ALL-UNNAMED",
        "--add-exports", "javafx.graphics/com.sun.glass.ui=ALL-UNNAMED",
        "--add-exports", "java.desktop/sun.awt=ALL-UNNAMED",
        "--add-exports", "javafx.graphics/com.sun.javafx.stage=ALL-UNNAMED"
]

Any suggestions as to why this error is being displayed?

0

There are 0 answers