It seems Oracle added these methods to compile java code with javac.
Class: ScriptingFileManager.java
@Override
public Iterable<Set<Location>> listLocationsForModules(Location location) throws IOException {
return this._wrapped.listLocationsForModules(location);
}
@Override
public String inferModuleName(Location location) throws IOException {
return this._wrapped.inferModuleName(location);
}
Without overriding these methods the server throws "UnsupportedOperation" exception and you have to downgrade your java version.
(Tested with java 19 and with --enable-preview option).
Greetings.
BONUS - Configure enable/disable preview java features:
ScriptEngine.ini
# Enable preview features: --enable-preview
previewFeatures = true
JavaExecutionContext.java
// Set options.
addOptionIfNotNull(_options, getProperty("source"), "-source");
addOptionIfNotNull(_options, getProperty("sourcepath"), "-sourcepath");
addOptionIfNotNull(_options, getProperty("g"), "-g:");
// Enable experimental/preview java features
if ("true".equalsIgnoreCase(getProperty("previewFeatures"))) {
_options.add("--enable-preview");
}