Re: An unexpected Netbeans Warning

Michael Bien <[email protected]>
Newsgroups gmane.comp.java.ide.netbeans.user
Message-ID <[email protected]>
Hi,

making a guess based on the log you provided: you run a maven 3 project on JDK 24?


This is the JDK complaining that some jar (e.g guava) is making method calls which were

deprecated for removal in a future java release. You should see the same output

when you run the build in the terminal - assuming the same environment.


Unfortunately those warnings aren't fixable at the moment, (technically the guava one is fixable

but this would just lead to the same thing from guice which doesn't have made an update release yet)


The next maven 3.9.10 update release which is currently baking will fix the first warning.

Once its available you can switch to it via the maven options or by using a maven wrapper.


You can ignore the warnings since they don't come from your Big Project (tm).

To suppress them, add a jvm.config file to your project as described in

https://maven.apache.org/configure.html and add:

--sun-misc-unsafe-memory-access=allow --enable-native-access=ALL-UNNAMED


regards,

-mbien


On 5/27/25 15:58, ChrisOlsen wrote:
> Good morning, Everyone --
>
>    Please pardon a question from a rank amateur programmer...
>
>    Yesterday I downloaded Netbeans 26 (more time on my hands at the end of the semester).  I have been happily using Netbeans 23.   I am now getting the following message when I run my Big Project:
>
> ---------------------------
> WARNING: A restricted method in java.lang.System has been called
> WARNING: java.lang.System::load has been called by org.fusesource.jansi.internal.JansiLoader in an unnamed module (file:/C:/Program%20Files/Apache%20NetBeans/java/maven/lib/jansi-2.4.1.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
>  
> WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
> WARNING: sun.misc.Unsafe::objectFieldOffset has been called by com.google.common.util.concurrent.AbstractFuture$UnsafeAtomicHelper (file:/C:/Program%20Files/Apache%20NetBeans/java/maven/lib/guava-33.2.1-jre.jar)
> WARNING: Please consider reporting this to the maintainers of class com.google.common.util.concurrent.AbstractFuture$UnsafeAtomicHelper
> WARNING: sun.misc.Unsafe::objectFieldOffset will be removed in a future release
> --------------------------
>
> I searched the internet and was (a) pleased to understand it was not just me with this problem, and (b) not pleased that I did not see a solution that I, amateur programmer, understood.  So I have a two-part question:
>
> a)  Is there a simple explanation of what is happening, one that a mere statistician would understand?
>
> b)  Should I just stick with Netbeans 23 (which does not at present give the warning), wait for libraries to catch up with the problem and an update to Netbeans 26+, or go with 26 and ignore the warning?
>
> TIA!
>
>   -- Chris



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.