Issue with an automatic module

charbel yazbeck charbel_yazbeck at hotmail.com
Tue Aug 2 07:21:18 UTC 2016


hi,


most of the open sources jars  have classes with unnamed package, like nar-maven-plugin.

Any idea how can i solve this? Do i have to implement my own version of ModuleFinder?

Some examples:  D:\.m2\jdom\jdom\1.0\jdom-1.0.jar, D:\.m2\net\java\dev\javacc\javacc\5.0\javacc-5.0.jar, D:\.m2\hsqldb\hsqldb\1.8.0.7\hsqldb-1.8.0.7.jar


thank you




________________________________
De : Alan Bateman <Alan.Bateman at oracle.com>
Envoyé : lundi 1 août 2016 22:00
À : charbel yazbeck; jigsaw-dev at openjdk.java.net
Objet : Re: Issue with an automatic module


On 01/08/2016 12:01, charbel yazbeck wrote:

hi


I was just trying the following sample:


        ModuleFinder finder = ModuleFinder.of(path);   //path points to the location of a jar with an unnamed module
        finder.findAll().forEach(System.out::println);

I see nar-maven-plugin-3.0.0.jar has a class HelpMojo.class, do you know if this is supposed to be in this JAR file?

In any case, it is as I said, named modules can not contain types in the unnamed package so this is why ModuleFinder fails. In this javadoc where it describes automatic it has the following "If a .class file that corresponds to a class in an unnamed package is encountered then FindException is thrown."

-Alan


More information about the jigsaw-dev mailing list