JEP 311: Java Packager API & CLI

Michael Hall mik3hall at gmail.com
Fri Oct 20 09:38:21 UTC 2017


> On Oct 20, 2017, at 4:33 AM, Alan Bateman <Alan.Bateman at oracle.com> wrote:
> 
> 
> 
> On 20/10/2017 09:29, Michael Hall wrote:
>>> On Oct 20, 2017, at 1:51 AM, Alan Bateman <Alan.Bateman at oracle.com> 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.
> 
> -Alan

OK thanks, if the packager itself made this unnecessary that would be nice. I’m not sure how it would detect the dependency automatically, but possibly an option to indicate necessary bin executables by the user? I haven’t tried the earlier suggested parameter yet but I’m guessing that will give me a full set of bin commands when all I seem to need is java.




More information about the jdk-dev mailing list