A service interface is provided but not exported or a warning is used in the-info class module

Java9 - jdk-9+181 intelliJ - 2017.2.2 built on August 9,2017 

The implementation of java.management.rmi module-info.java looks something like this:

 module java.management.rmi { ... requires transitive java.management; exports com.sun.jmx.remote.protocol.rmi to java.management; provides javax.management.remote.JMXConnectorProvider with com.sun.jmx.remote.protocol.rmi.ClientProvider; provides javax.management.remote.JMXConnectorServerProvider with com.sun.jmx.remote.protocol.rmi.ServerProvider; } 

For the provides statement, I received a compiler message with the message

Service interface provided but not exported or not used

In the end, I did not understand when I tried to use them in another module:

 module interactor { requires java.management.rmi; uses javax.management.remote.JMXConnectorProvider; } 

The warning still remains.

In addition, I could also reach java.management to find

 uses javax.management.remote.JMXConnectorProvider; uses javax.management.remote.JMXConnectorServerProvider; 

What is the reason for this warning and how can this be resolved?

Attaching a screenshot as requested in the comments:

enter image description here

+5
source share
1 answer

For any future links, this may turn out to be relevant due to some regressions in IntelliJ updates, answering it myself.

This was a bug with IntelliJ and was tracked on IDEA-178041 , resulting in:

exclusion of some JDK modules or libraries from the module graph used to generate an alert.


September 7, 2017 Patch

The issue is fixed using IntelliJ IDEA 2017.3 EAP .

 IntelliJ IDEA 2017.3 EAP (Community Edition) Build #IC-173.2099.14, built on September 6, 2017 JRE: 1.8.0_152-release-915-b11 x86_64 JVM: OpenJDK 64-Bit Server VM by JetBrains sro 
+1
source

Source: https://habr.com/ru/post/1271217/


All Articles