[ 
https://issues.apache.org/jira/browse/MNG-8399?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17939010#comment-17939010
 ] 

Garret Wilson commented on MNG-8399:
------------------------------------

I'm actually getting two warnings with Maven 3.9.9 using the released Java 
24+36 on Windows:

{code}
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 
(…/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 
(…/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
{code}

It looks like this has already been fixed in Guava 
([issues/7565|https://github.com/google/guava/issues/7565]). It has been noted 
in Jansi ([issues/301|https://github.com/fusesource/jansi/issues/301]).

> JDK 24+ issues warning about usage of sun.misc.Unsafe
> -----------------------------------------------------
>
>                 Key: MNG-8399
>                 URL: https://issues.apache.org/jira/browse/MNG-8399
>             Project: Maven
>          Issue Type: Improvement
>    Affects Versions: 3.9.9
>            Reporter: Marc Philipp
>            Priority: Minor
>         Attachments: build.log
>
>
> When running a build with JDK 24-ea+26 or later, the following warning is 
> issued by default:
> {noformat}
> 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:/home/marc/.asdf/installs/maven/3.9.9/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 {noformat}
> The source of this can be further investigated using the 
> {{--sun-misc-unsafe-memory-access=debug}} JVM argument from [JEP 
> 498|https://openjdk.org/jeps/498#Identifying-uses-of-the-memory-access-methods-in-sun-misc-Unsafe]
>  (see attached log file).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to