Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to build/use PL/Java on Java 23 #503

Merged
merged 2 commits into from
Oct 5, 2024

Conversation

jcflack
Copy link
Contributor

@jcflack jcflack commented Oct 4, 2024

These changes take care of building and using PL/Java on Java 23.

The JDK 23 release notes do not announce any new features that would need to be exposed in PL/Java's API for use by user code.

Naturally, no patch will begin using Java 23 features within PL/Java itself until a future major release adopts a newer minimum build version.

No issues observed in compiling manually (without the Maven
directive specifying an earlier --release) on Oracle JDK 23 GA.

cd pljava-api/src/main/java
/var/tmp/jdk-23/bin/javac -d ../../../target/classes/ \
 -Xlint:unchecked -Xlint:-removal --module-version 1.6-SNAPSHOT \
 $(find . -name '*.java')
cd ../../..
/var/tmp/jdk-23/bin/jar cf target/pljava-api-1.6-SNAPSHOT.jar \
 -C target/classes .

cd ../pljava/src/main/java
/var/tmp/jdk-23/bin/javac --module-version 1.6-SNAPSHOT \
 -d ../../../target/classes/ \
 --module-path ../../../../pljava-api/target/pljava-api-1.6-SNAPSHOT.jar \
 --processor-module-path \
  ../../../../pljava-api/target/pljava-api-1.6-SNAPSHOT.jar \
 -Xlint:unchecked -Xlint:-removal $(find . -name '*.java')
cd ../../../
/var/tmp/jdk-23/bin/jar cf target/pljava-1.6-SNAPSHOT.jar \
 -C target/classes .

cd ../pljava-examples/src/main/java
/var/tmp/jdk-23/bin/javac -d ../../../target/classes/ \
 --module-path ../../../../pljava-api/target/pljava-api-1.6-SNAPSHOT.jar \
 --processor-module-path \
  ../../../../pljava-api/target/pljava-api-1.6-SNAPSHOT.jar \
 --class-path \
  ~/.m2/repository/net/sf/saxon/Saxon-HE/10.9/Saxon-HE-10.9.jar: \
 -Xlint:unchecked -Xlint:-removal \
 --add-modules org.postgresql.pljava $(find . -name '*.java')
cd ../../../target/classes
zip -r ../pljava-examples-1.6-SNAPSHOT.jar *
# zip because jar m doesn't preserve order of manifest entries
cd ../../../
# with dir of intended pg_config version on PATH:
mvn clean install --projects pljava-packaging
As of Java 23, the necessary mechanisms have not yet
been disabled. (There is probably, though, with increasing
versions, an increasing risk of Java internals that lack
doPrivileged and will end up needing to leak into policy.)
@jcflack jcflack merged commit 3118cf2 into REL1_6_STABLE Oct 5, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant