Application with mix of module and jars

Alan Bateman Alan.Bateman at oracle.com
Tue Jun 21 08:48:02 UTC 2016


On 21/06/2016 00:06, vishal jain wrote:

> This works :
> java -mp mlib -addmods module2  -cp jars/nonmodule.jar 
> nonmodule.NonModuleClass
> NonModule Say Hello
>
> Whereas this does not :
> java -modulepath mlib -addmods ALL-MODULE-PATH  -cp jars/nonmodule.jar 
> nonmodule.NonModuleClass
> Error: Main method not found in class nonmodule.NonModuleClass, please 
> define the main method as:
>    public static void main(String[] args)
>
Can you run with `-verbose`? I assume the issue is that 
nonmodule.NonModuleClass is being loaded from a module in your mlib 
directory and from the error, this version of NonModuleClass does not 
public static void main method.

(In time then the launcher should fail when nonmodule.NonModuleClass is 
loaded from a named module when an unnamed module is expected. The 
reason it doesn't tied into a complicated issue around boot cycle builds 
that should get resolved in time).

-Alan


More information about the jigsaw-dev mailing list