rpncalc icon indicating copy to clipboard operation
rpncalc copied to clipboard

Java warning

Open r0bis opened this issue 8 months ago • 3 comments

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

r0bis avatar Apr 16 '25 20:04 r0bis

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.

frossm avatar Apr 16 '25 21:04 frossm

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

frossm avatar Apr 16 '25 21:04 frossm

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.

r0bis avatar Apr 17 '25 09:04 r0bis