PL/Java is a free add-on module that brings Java™ Stored Procedures, Triggers, Functions, Aggregates, Operators, Types, etc., to the PostgreSQL™ backend.
PL/Java code loaded with install_jar is treated as unnamed-module, legacy classpath code. Such code is advertised as having access to all readable modules, without having to declare dependencies (as it can't declare dependencies; it would have to be a named module to do that).
Ah, but what are "all readable modules"? Only the ones enumerated at JVM startup, using as root modules PL/Java itself and anything named with --add-modules. So that option must be used if any Java modules will be needed beyond the ones PL/Java itself depends on. PL/Java's documentation didn't explain this.
PL/Java code loaded with
install_jar
is treated as unnamed-module, legacy classpath code. Such code is advertised as having access to all readable modules, without having to declare dependencies (as it can't declare dependencies; it would have to be a named module to do that).Ah, but what are "all readable modules"? Only the ones enumerated at JVM startup, using as root modules PL/Java itself and anything named with
--add-modules
. So that option must be used if any Java modules will be needed beyond the ones PL/Java itself depends on. PL/Java's documentation didn't explain this.This added documentation addresses #419.