SOLUTION :
my bad it was a build.gradle problem, by removing 'org.javamodularity.moduleplugin' version 1.8.12 from it, coc-java worked again !! But thank you all for your help !
I am working with Neovim and use coc.nvim for autocompletion, diagnosises, etc.
For Java, I am using coc-java and everything worked fine until I tried to code with JavaFX. coc.nvim doesn't recognize it :
package my.project.package;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.stage.Stage;
public class Main extends Application {
@Override
public void start(Stage stage) throws IOException {
FXMLLoader fxmlLoader = new FXMLLoader(Main.class.getResource("welcome.fxml"));
Scene scene = new Scene(fxmlLoader.load(), 1000, 1000);
stage.setScene(scene);
stage.show();
}
public static void main(String[] args) {
launch();
}
}
In my editor, hovering any import from javafx display the error The type javafx.package.Module is not accessible (Java 16778666) (same thing for anything related to these imports of course). However, this program works fine when I execute it.
So I have tried to change my language server parameters, here is my coc-settings.json :
{
"java.home": "/home/yayel4289/.jdks/jdk-20.0.2",
"java.jdt.ls.vmargs": "-Xmx1G -XX:+UseG1GC --module-path=/usr/share/openjfx/lib --add-modules=javafx.controls,javafx.fxml,javafx.base,javafx.graphics,javafx.media",
"java.project.referencedLibraries": [
"/usr/share/openjfx/lib/*.jar"
],
"java.trace.server": "verbose",
}
I also have logs in ~/.config/coc/extensions/coc-java-data, it is too heavy to put it here but would it help in any way?
List,Junit, ...) but not JavaFX, I believe it is because it's not in the 'base' dependencies. So to answer your last quesiton : only JavaFX have this problem. However, after deleting~/.config/coc/extensions/coc-java-data, coc-java now recognize classes likeScene,Stage, etc (there is a description and it is in the autocompletion buffer) but it still in red and coc-java doesn't recognize any method or attributes these objects can have (like getStyleSheets(), ...)