Skip to content

Java warning #12

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

Open
r0bis opened this issue Apr 16, 2025 · 3 comments
Open

Java warning #12

r0bis opened this issue Apr 16, 2025 · 3 comments

Comments

@r0bis
Copy link

r0bis commented Apr 16, 2025

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
@frossm
Copy link
Owner

frossm commented Apr 16, 2025

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
Copy link
Owner

frossm commented Apr 16, 2025

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

@r0bis
Copy link
Author

r0bis commented Apr 17, 2025

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.

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

No branches or pull requests

2 participants