How to configure modulePath for an unmanaged folder in VSCODE

65 Views Asked by At

I want to move away from Maven builds.

I have a module-info.java that is correctly resolved when the required modular JARs are stated as dependencies in the POM, that is, when using maven with vscode. When I remove the POM the "requires" in module-info.java goes red "... cannot be resolved to a module".

module-info.jar

module net.kwami.utils {
    requires transitive org.apache.logging.log4j;
    requires transitive com.google.gson;
    requires transitive org.yaml.snakeyaml;
    exports net.kwami.utils;
}

Compiling from the command-line works:

bin$ javac -d ../target --module-path ../lib $(find ../src/main -name "*.java")
bin$

The Referenced Libraries tab in vscode automatically shows the modular JARs because I have them in tne lib directory of the folder.

I tried to add --module-path to the vmargs of the Redhat Language Server. I tried to add modulePath to the runtime configuration but that is not allowed and intellisense does not offer it.

I expected the language server to detect the module descriptor and use the configured Referenced Libraries as the --module-path used by the compiler.

0

There are 0 best solutions below