Closed caseylai closed 1 year ago
I believe (without actually trying it just now) that the solution will be to include --add-modules java.net.http
in pljava.vmoptions
.
PL/Java does not (yet) treat your code as modular; effectively, it puts your code on the class path, not the module path. That would normally give your code the "unnamed module" behavior where dependencies don't have to be declared.
PL/Java itself, however, is modular, so there is a restricted module graph in effect before your code is loaded, and your code can only use the modules that graph includes. So --add-modules
to include the modules you want in the graph should do the trick.
The existing modules documentation in PL/Java , I see, does not explain this very well. I will add to it.
Resolved in 1.6.5 by adding documentation for --add-modules
.
I have a simple PL/Java program of using JDK 11 (also tried 17) java.net.http.HttpClient to request another restful service. Successfully compiling by maven and
install_jar
andset_classpath
in PostgreSQL, but when executing the function, an error is thrown for 'java.lang.NoClassDefFoundError: java/net/http/HttpClient'.Have tried to add
java.net.http
jmod path topljava.module_path
, but not solve it. Could anyone help?