Java issue- WARNING: An illegal reflective access operation has occurred

sonarcloud
(Alan Rickels) #1

Running a SonarCloud code analysis through Azure DevOps results in some unpleasant errors when using openjdk-11 (Java 10.0.2):

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.protobuf.UnsafeUtil (file:/opt/vsts-agent/.sonar/cache/e62315a34b56db679102b0a9639a11d9/sonar-scanner-engine-shaded-developer-7.7.0.22010-all.jar) to field java.nio.Buffer.address
WARNING: Please consider reporting this to the maintainers of com.google.protobuf.UnsafeUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

The analysis process works as intended, but the errors are alarming to viewers.

Using Azul Java 1.8.0_202 does not alarm to those deprecated operations, but is unfortunately not an option for us.

Any guidance as to the recommended JDK for code analysis through a CI tool?

(Tibor Blenessy) #2

Hello,

this is expected. We are using protobuf and there is no solution available for the time being (see here https://github.com/protocolbuffers/protobuf/issues/5549 )

You can safely use Java 11 and ignore these warnings. Once there is newer version of protobuf we will upgrade to it.

1 Like
(James) #3

Is there any movement with this or is there a way to disable it a im currently using java11 and im getting the same issue?