How to find the name of a module of a class in Java 9+?

User8461 :

I try to migrate from JavaFX 8 to 9+.

How can I find the modules named for the existing classes?

Here the example for my problem:

It was hard to find out that javax.smartcardio must use the module name java.smartcardio. Is the a lookup table to find the module names? Intelij Idea does not find it on fly.

module xyz {
    // import javax.smartcardio.*;
    requires transitive java.smartcardio;

    // import javax.swing.*;
    requires transitive java.desktop;
 }

Is there an easy way to solve this?

Jorn Vernee :

You can use the search function of the online javadoc: https://docs.oracle.com/en/java/javase/11/docs/api/index.html

To look up the package by name:

enter image description here

Then on the javadoc page of the package the module it's in is in the top left:

enter image description here

(Note that the module name also shows up in the search auto-complete dialogue)

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=80131&siteId=1