diff --git a/apps/i2psnark/java/build.xml b/apps/i2psnark/java/build.xml index 3346039adf1ca7777685cd349c58805e8752e0e5..339f440cdda0da8a2dc37127c320b7e30e5cc4c9 100644 --- a/apps/i2psnark/java/build.xml +++ b/apps/i2psnark/java/build.xml @@ -261,6 +261,11 @@ <attribute name="Workspace-Changes" value="${workspace.changes.tr}" /> <attribute name="X-Compile-Source-JDK" value="${javac.version}" /> <attribute name="X-Compile-Target-JDK" value="${javac.version}" /> + <!-- + Suppress JNI warning in JRE 24+, and eventual restriction + See https://openjdk.org/jeps/472 + --> + <attribute name="Enable-Native-Access" value="ALL-UNNAMED" /> <!-- this is so Jetty will report its version correctly --> <section name="org/eclipse/jetty/server/" > <attribute name="Implementation-Vendor" value="Eclipse.org - Jetty" /> diff --git a/core/java/build.xml b/core/java/build.xml index 8b36ce5f0bb201f3c67e8c04aa106fa8dcafc65b..f934f4ee4e8ae4184ebc749e4b6c9abac5b3f232 100644 --- a/core/java/build.xml +++ b/core/java/build.xml @@ -129,6 +129,13 @@ <attribute name="Workspace-Changes" value="${workspace.changes.tr}" /> <attribute name="X-Compile-Source-JDK" value="${javac.version}" /> <attribute name="X-Compile-Target-JDK" value="${javac.version}" /> + <!-- + Suppress JNI warning in JRE 24+, and eventual restriction + See https://openjdk.org/jeps/472 + This only works for CLI with this as the named -jar argument; + for normal runtime it must be suppressed in wrapper.config + --> + <attribute name="Enable-Native-Access" value="ALL-UNNAMED" /> </manifest> </jar> </target> diff --git a/installer/resources/wrapper.config b/installer/resources/wrapper.config index 3e353cfa4832aadb48d85cad1538fdd605f64dd5..e3a718820656ea1f4bca33bb9a4acec14e2128db 100644 --- a/installer/resources/wrapper.config +++ b/installer/resources/wrapper.config @@ -77,6 +77,13 @@ wrapper.java.additional.1=-DloggerFilenameOverride=logs/log-router-@.txt wrapper.java.additional.2=-Di2p.dir.base="$INSTALL_PATH" wrapper.java.additional.2.stripquotes=TRUE +# Suppress JNI warning in JRE 24+, and eventual restriction +# See https://openjdk.org/jeps/472 +# This will fail on JRE 11 or lower, works on JRE 17+ +#wrapper.java.additional.3=--enable-native-access=ALL-UNNAMED +# Alternative that _may_ work on all JRE versions: +#set.JDK_JAVA_OPTIONS=--enable-native-access=ALL-UNNAMED + # Prevent the JVM from exporting stats (and thereby causing hundreds of # ms long pauses during GC) # http://www.evanjones.ca/jvm-mmap-pause.html diff --git a/router/java/build.xml b/router/java/build.xml index 4b0cedf2bcf626ad41de03d38141952349cc2248..2286b72cb3b74f51592369740a2cbc2ec61bd6f2 100644 --- a/router/java/build.xml +++ b/router/java/build.xml @@ -99,6 +99,13 @@ <attribute name="Workspace-Changes" value="${workspace.changes.tr}" /> <attribute name="X-Compile-Source-JDK" value="${javac.version}" /> <attribute name="X-Compile-Target-JDK" value="${javac.version}" /> + <!-- + Suppress JNI warning in JRE 24+, and eventual restriction + See https://openjdk.org/jeps/472 + This only works for CLI with this as the named -jar argument; + for normal runtime it must be suppressed in wrapper.config + --> + <attribute name="Enable-Native-Access" value="ALL-UNNAMED" /> </manifest> </jar> </target>