Access to “parent scope” in JShell

…衆ロ難τιáo~ 提交于 2019-12-05 06:40:34

According to this the one big caveat about JShell is: it runs in its own JVM.

The javadoc for create() says:

Equivalent to JShell.builder().build().

And when you follow to the javadoc for build(), you find:

Build a JShell state engine. This is the entry-point to all JShell functionality. This creates a remote process for execution. It is thus important to close the returned instance.

In other words: most likely, you are creating another JVM instance where that other shell runs. So at least for now: no chances of having a child jshell know about its parent.

( as in: I seriously hope that this REPL feature of Java will allow at some future point to attach a JShell to an already running JVM )

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!