Can I Disable Console Warnings for sun.misc.Unsafe?

0
0
Asked By ChocoLover92 On

I'm working on a command-line tool that's packaged in a Docker image, and I really want to avoid showing the console warnings related to sun.misc.Unsafe to my users. I totally get why these warnings are important given the eventual deprecation and removal of this functionality, but my customers might not understand that. The warnings stem from a third-party library I'm using. I've searched online and even tried using AI to find a solution, but nothing seems to work. Any suggestions?

1 Answer

Answered By TechieGuru45 On

You can try using the flag `--sun-misc-unsafe-memory-access=allow` as mentioned in JEP 498. But keep in mind that the Unsafe methods might be removed in future JDKs, so you'll either have to stick to your current JDK or find an alternative to the library causing the warning. It's not a permanent fix, but it could help for now.

CodeWhiz88 -

He already mentioned he understands that, but he just wants to avoid the warning message, not rewrite everything!

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.