javafx-gradle-plugin icon indicating copy to clipboard operation
javafx-gradle-plugin copied to clipboard

Since v0.0.12 vscode does not find modules

Open miqmago opened this issue 2 years ago • 3 comments

With gradle 7.6 I had to downgrade to v0.0.11 in vscode.

Since v0.0.12 the application compiles and runs fine but vscode throws multiple errors:

module-info.java:

open module myGradle {
    requires javafx.controls;
    requires javafx.fxml;
    requires transitive javafx.graphics;
    ...
}

Errors:

  • javafx.controls cannot be resolved to a module Java(8389908)
  • javafx.fxml cannot be resolved to a module Java(8389908)
  • javafx.graphics cannot be resolved to a module Java(8389908)

In App.java:

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
...

Errors:

  • The type javafx.fxml.FXMLLoader is not accessible Java(16778666)
  • The type javafx.application.Application is not accessible Java(16778666)
  • ...

miqmago avatar Jan 08 '23 13:01 miqmago

Same. I'm still stuck on v0.0.11 because I couldn't use any later version no matter what I tried. Is it an issue with VSCode or one of its plugins? Or is it the gradle plugin / gradle dependency manager?

megabyte6 avatar Jan 19 '23 01:01 megabyte6

Same.

plugins {
    id 'org.openjfx.javafxplugin' version '0.0.13'
}

Setting the plugin to v0.0.12 or v.0.0.13 causes VSCode to report visibility errors for code provided by modules, not only the JavaFx classes. Example of the error: The type javafx.geometry.Insets is not accessible Java(16778666)

Reverting back to v0.0.11, the errors disappear (after running Clean Workspace>Reload and delete on the Java project).

Moving to v0.0.13 is necessary to avoid deprecated attributes now removed in Gradle 8.0, so this issue is becoming a block on upgrading Gradle.

I note that commit 02d36b8f1cbac46c8faeb01ade45f399c37eb9fd updated the org.javamodularity:moduleplugin from 1.8.2 to 1.8.10, and that this is being bumped again to 1.8.12 in the upcoming v0.0.14 via issue #138. Need to see if that helps!

turlingdrome avatar Apr 04 '23 17:04 turlingdrome

It seems to be an issue with the upstream Eclipse language server that's being used for vscode's java plugin.

Here are a couple temporary solutions I found online:

megabyte6 avatar Apr 25 '23 22:04 megabyte6