JEP 311: Java Packager API & CLI

victor.drozdov at victor.drozdov at
Fri Oct 20 19:38:57 UTC 2017

On 10/20/17 2:33 AM, Alan Bateman wrote:

> On 20/10/2017 09:29, Michael Hall wrote:
>>> On Oct 20, 2017, at 1:51 AM, Alan Bateman <Alan.Bateman at> 
>>> wrote:
>>> On 19/10/2017 22:37, Michael Hall wrote:
>>>> :
>>>> Thanks. I couldn’t figure out how to use it with the current 
>>>> javapackager. It turned out I needed —add-modules, I’m new to 
>>>> modular concerns.
>>>> This was for JShell. It also seemed that this needed a java 
>>>> executable in the bin directory. I added that manually and was able 
>>>> to use JShell from a OS X java 9 application.
>>> I realize this is going off-topic but can you elaborate more on 
>>> this. There should never be a need to copy binaries into the bin 
>>> directory. The jdk.jshell module includes `jshell` launcher for 
>>> example.
>> I got a JShell JRE with —add-modules
>> I initialize a JShell shell with…
>>     private static final JShell shell = JShell.create();
>> Without java in the bin directory the first time I try to use the 
>> shell with…
>>             List<SnippetEvent> result = shell.eval(sb.toString());
>>             for (SnippetEvent evt : result) {
>>                 System.out.println(evt.value());
>>             }
>> I get…
> Someone more familiar with the packager would be in a better position 
> to answer this. I suspect the issue is that packager is filtering out 
> the java launcher as it expects the generated distribution to be only 
> used to run one application. It doesn't know that adding jshell needs 
> the java launcher.
"bin" is filtered out by default because javapackager uses JNI to create 
JVM. There are args to include "bin" into the final app image. We may 
consider including "bin" by default or documenting this issue.

> -Alan

More information about the jdk-dev mailing list