You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JSnapLoader v1.1.1 does not define a module, so Java considers it part of the Unnamed Module.
For this reason, when jSnapLoader invokes the System.load() method, Java 24 issues a runtime warning:
WARNING: A restricted method in java.lang.System has been called
This warning can be suppressed using --enable-native-access=ALL-UNNAMED. However, this workaround is risky from a security standpoint because it might give access to large swaths of code that don't need such access.
To mitigate this risk, it would better if jSnapLoader defined its own module, which should probably be named electrostatic4j.snaploader.
These used to cause annoying problems for platforms that were primarily dependent on Java 8 (e.g., Android). I don't know the new Android updates. However, I believe all Java 11 features are supported now.
As of 2026, I believe Java 21 support is more vital than Java 8 support, but I don't have any data to support that belief.
Have you ever tested jSnapLoader with Java 8?
6. As of 2026, I believe Java 21 support is more vital than Java 8 support, but I don't have any data to support that belief.
Have you ever tested jSnapLoader with Java 8?
jSnapLoader was first bundled with Serial4j that was working on Java 8; then upgraded to 19 w/o changing the code; since that, the library has been separated. It should work flawlessly as it uses legacy language features.
For this reason, when jSnapLoader invokes the System.load() method, Java 24 issues a runtime warning:
WARNING: A restricted method in java.lang.System has been called
Furthermore, I believe this warning was thrown because of Gradle libraries, and not particularly from jSnapLoader:
WARNING: Arestrictedmethodinjava.lang.SystemhasbeencalledWARNING: java.lang.System::loadhasbeencalledbynet.rubygrapefruit.platform.internal.NativeLibraryLoaderinanunnamedmodule (file:/home/runner/.gradle/wrapper/dists/gradle-9.8.1-bin/a2l6ltp3k1vth6lwipzm5p2jp/gradle-9.8.1/lib/native-platform-0.22-milestone-29.jar)
WARNING: Use --enable-native-access=ALL-UNNAMEDtoavoidawarningforcallersinthismoduleWARNING: Restrictedmethodswillbeblockedinafuturereleaseunlessnativeaccessisenabled
It is thrown even though after introducing modules.
./gradlew :wrapper --gradle-version=9.8.1 && ./gradlew :wrapper is the correct way to update Gradle to version 9.8.1. It manages the necessary changes to 4 files:
gradlew
gradlew.bat
gradle/wrapper/gradle-wrapper.jar and
gradle/wrapper/gradle-wrapper.properties .
Merely updating the properties file and the JAR file isn't always sufficient to complete an upgrade.
Activity
pavly-gerges commentedon Oct 9, 2026
Notice that; Java Modules are supported from Java 9+. Therefore, once updated, jSnapLoader will not work anymore on applications compiled with Java 8.
pavly-gerges commentedon Oct 9, 2026
These used to cause annoying problems for platforms that were primarily dependent on Java 8 (e.g., Android). I don't know the new Android updates. However, I believe all Java 11 features are supported now.
stephengold commentedon Oct 9, 2026
As of 2026, I believe Java 21 support is more vital than Java 8 support, but I don't have any data to support that belief.
Have you ever tested jSnapLoader with Java 8?
pavly-gerges commentedon Oct 9, 2026
jSnapLoader was first bundled with Serial4j that was working on Java 8; then upgraded to 19 w/o changing the code; since that, the library has been separated. It should work flawlessly as it uses legacy language features.
Furthermore, I believe this warning was thrown because of Gradle libraries, and not particularly from jSnapLoader:
It is thrown even though after introducing modules.
May you please test a standalone JAR?
pavly-gerges commentedon Oct 9, 2026
See:
gradle/gradle#33608
stephengold commentedon Oct 9, 2026
Have you tried:
$ ./gradlew :wrapper --gradle-version=9.8.1 && ./gradlew :wrapper?
pavly-gerges commentedon Oct 10, 2026
No, I haven't. I've updated the gradle wrapper from the gradle properties.
pavly-gerges commentedon Oct 10, 2026
It seems that the JAR file has not been replaced; https://github.com/Electrostat-Lab/jSnapLoader/blob/master/gradle/wrapper/gradle-wrapper.jar.
pavly-gerges commentedon Oct 10, 2026
I will try to update the JAR file instead.
stephengold commentedon Oct 10, 2026
./gradlew :wrapper --gradle-version=9.8.1 && ./gradlew :wrapperis the correct way to update Gradle to version 9.8.1. It manages the necessary changes to 4 files:Merely updating the properties file and the JAR file isn't always sufficient to complete an upgrade.