Java warning
Upon launching rpncalc 5.4.0 I get a 4 line warning
WARNING: A restricted method in java.lang.System has been called
WARNING: java.lang.System::load has been called by org.jline.nativ.JLineNativeLoader in an unnamed module (file:/usr/local/bin/rpncalc.jar)
WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled
I wonder if there is an easy way to fix this?
Available Java environments:
java-24-openjdk (default)
java-8-openjdk/jre
I just saw this today as well. It started happening to me when I upgraded to Java 24 from 23. I'll need to look at it when I get time, but it's probably something the JLine team will fix. That's not my code, but maybe I can configure it with the --enable-native-access=ALL-UNNAMED mentioned in the error.
I don't know the impacts of doing this from a security perspective, but this seems to remove the error:
java --enable-native-access=ALL-UNNAMED -jar c:\utils\rpncalc.jar
If you have an alias to run RPNCalc, perhaps include this switch in the alias. Obviously, you'll need to add the path where you keep RPNCalc.jar
Thanks, no worries. I have put is in /usr/local/bin so it is available to all users on the system, but I will do an alias rpn there instead with the switch. And maybe in time JLine team will fix this.