RFR: JDK-8261518: jpackage looks for main module in current dir when there is no module-path [v2]
Andy Herrick
herrick at openjdk.java.net
Wed Mar 3 13:59:02 UTC 2021
On Wed, 3 Mar 2021 00:31:34 GMT, Alexey Semenyuk <asemenyuk at openjdk.org> wrote:
>> Andy Herrick has updated the pull request incrementally with one additional commit since the last revision:
>>
>> JDK-8261518: jpackage looks for main module in current dir when there is no module-path
>
> test/jdk/tools/jpackage/share/jdk/jpackage/tests/NoMPathRuntimeTest.java line 125:
>
>> 123: .addArguments("-cvf", "junk.jar",
>> 124: "-C", tmpdir.toString(), "Hello.class")
>> 125: .execute();
>
> Single line `HelloApp.createBundle("junk.jar:Hello", tmpdir);` would compile source class and put it into "junk.jar" in `tmpdir` folder. It can be used to replace lines from [109, 125] range.
>
> What is the point to build "junk.jar"? I don't see how it is used in the test.
The bug is that when --module-path option is not used in a modular app, jpackage uses a module-path with "." on it.
Having a non-modular jar in the modular path is an error.
So with this non-modular Hello.jar in the current directory the jpackage command failed before the fix, and succeeds after the fix.
I can create the non-modular Hello.jar in the current directory with one line:
HelloApp.createBundle(JavaAppDesc.parse("junk.jar:Hello"), Path.of("."))
-------------
PR: https://git.openjdk.java.net/jdk/pull/2781
More information about the core-libs-dev
mailing list