How to reproduce:
1. Create a jimage with the following command:
jlink --add-modules jdk.jshell --module-path $JDK/jmods
--output foo
2. Run the "jshell" command, but no jshell prompt appears, just seems hanging.
If "jdk.jdwp.agent" module is added, it works just fine. This seems due to lacking of JDI implementation. In such a case, jshell should exit gracefully without hanging.
--- here is the mail exchange with Sundar ---
That said, it may be a bug in jshell that it does not report missing JDI
service provider gracefully and exit!
-Sundar
On 9/9/2016 11:27 PM, Sundararajan Athijegannathan wrote:
> Hi Naoto,
>
> [CC'ing Jan Lahoda as well]
>
> If you use the following command line, resultant image works:
>
> jlink --add-modules jdk.jshell, jdk.jdwp.agent --module-path $JDK/jmods
> --output foo
>
> Note that you don't need to set all the transitive dependencies - just
> the root modules will do. jdk.jdwp.agent module has the service provider
> for JDI interfaces. jdk.jshell has only JDI (jdk.jdi) dependency and
> not on service provider impl directly. So, you need to explicitly set
> jdk.jdwp.agent module as one of the root modules.
>
> -Sundar
>
> On 9/9/2016 10:12 PM, Naoto Sato wrote:
>> Here is the command line:
>>
>> nsato@nsato-VirtualBox:/projects/jdk/9/dev$
>> ./build/linux-x64/images/jdk/bin/jlink --module-path
>> ./build/linux-x64/images/jdk/jmods/ --add-modules
>> java.desktop,java.compiler,java.prefs,java.datatransfer,java.xml,jdk.localedata,jdk.compiler,jdk.jshell,jdk.internal.le,jdk.internal.opt,jdk.jdi,jdk.attach,jdk.jvmstat
>> --output ../images --include-locales ja,zh,ko,th,vi
>>
>> Naoto
>>
>> On 9/9/16 9:37 AM, Sundararajan Athijegannathan wrote:
>>> Na Naoto,
>>>
>>> What was your command line? Something like this?
>>>
>>> jlink --add-mods jdk.jshell --module-path $JDK/jmods --output foo
>>>
>>>
>>> -Sundar
>>>
>>> On 9/9/2016 10:05 PM, Naoto Sato wrote:
>>>> Hi Sundar,
>>>>
>>>> I've been playing around the images created by the jlink tool. What I
>>>> noticed was that when I create a jimage specific only for jshell
>>>> (i.e., --add-mods only involves those dependent platform modules for
>>>> jdk.jshell module), jshell won't run and just hung up.
>>>>
>>>> I looked into it a bit and found that two native libraries are
>>>> missing, i.e., libjdwp and libdt_socket (on linux_x64). Just wondering
>>>> whether this is a known issue or not.
>>>>
>>>> Naoto
1. Create a jimage with the following command:
jlink --add-modules jdk.jshell --module-path $JDK/jmods
--output foo
2. Run the "jshell" command, but no jshell prompt appears, just seems hanging.
If "jdk.jdwp.agent" module is added, it works just fine. This seems due to lacking of JDI implementation. In such a case, jshell should exit gracefully without hanging.
--- here is the mail exchange with Sundar ---
That said, it may be a bug in jshell that it does not report missing JDI
service provider gracefully and exit!
-Sundar
On 9/9/2016 11:27 PM, Sundararajan Athijegannathan wrote:
> Hi Naoto,
>
> [CC'ing Jan Lahoda as well]
>
> If you use the following command line, resultant image works:
>
> jlink --add-modules jdk.jshell, jdk.jdwp.agent --module-path $JDK/jmods
> --output foo
>
> Note that you don't need to set all the transitive dependencies - just
> the root modules will do. jdk.jdwp.agent module has the service provider
> for JDI interfaces. jdk.jshell has only JDI (jdk.jdi) dependency and
> not on service provider impl directly. So, you need to explicitly set
> jdk.jdwp.agent module as one of the root modules.
>
> -Sundar
>
> On 9/9/2016 10:12 PM, Naoto Sato wrote:
>> Here is the command line:
>>
>> nsato@nsato-VirtualBox:/projects/jdk/9/dev$
>> ./build/linux-x64/images/jdk/bin/jlink --module-path
>> ./build/linux-x64/images/jdk/jmods/ --add-modules
>> java.desktop,java.compiler,java.prefs,java.datatransfer,java.xml,jdk.localedata,jdk.compiler,jdk.jshell,jdk.internal.le,jdk.internal.opt,jdk.jdi,jdk.attach,jdk.jvmstat
>> --output ../images --include-locales ja,zh,ko,th,vi
>>
>> Naoto
>>
>> On 9/9/16 9:37 AM, Sundararajan Athijegannathan wrote:
>>> Na Naoto,
>>>
>>> What was your command line? Something like this?
>>>
>>> jlink --add-mods jdk.jshell --module-path $JDK/jmods --output foo
>>>
>>>
>>> -Sundar
>>>
>>> On 9/9/2016 10:05 PM, Naoto Sato wrote:
>>>> Hi Sundar,
>>>>
>>>> I've been playing around the images created by the jlink tool. What I
>>>> noticed was that when I create a jimage specific only for jshell
>>>> (i.e., --add-mods only involves those dependent platform modules for
>>>> jdk.jshell module), jshell won't run and just hung up.
>>>>
>>>> I looked into it a bit and found that two native libraries are
>>>> missing, i.e., libjdwp and libdt_socket (on linux_x64). Just wondering
>>>> whether this is a known issue or not.
>>>>
>>>> Naoto
- relates to
-
JDK-8166237 jdk.jdi missing requires jdk.jdwp.agent
-
- Resolved
-