Application with mix of module and jars
Hamlin Li
huaming.li at oracle.com
Tue Jun 21 06:55:49 UTC 2016
Hi Vishal,
Something in your environment should be wrong. Attached sample test
passed with both -addmods m1 and -addmods ALL-MODULE-PATH
Thank you
-Hamlin
On 2016/6/21 7: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)
>
>
>
> On Mon, Jun 20, 2016 at 1:51 PM, <mark.reinhold at oracle.com> wrote:
>
>> 2016/6/20 12:20:51 -0700, alan.bateman at oracle.com:
>>> ...
>>>
>>> If you add `-addmods module1` to the command line then I assume it will
>>> work. The reason you need this is because there isn't any module that
>>> has declared a dependency on "module1". The "Root modules" section in
>>> JEP 261 [1] has the details on the root modules to resolve at startup.
>>>
>>> -Alan
>>>
>>> [1] http://openjdk.java.net/jeps/261
>> Handy direct link: http://openjdk.java.net/jeps/261#Root-modules
>>
>> (URI fragment identifiers FTW!)
>>
>> - Mark
>>
>
>
More information about the jigsaw-dev
mailing list