您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

如何在Java 9中获取JShell文档?

2025/10/30 21:24:23发布19次查看
java 9 引入了一种新的交互式工具,称为jshell。该工具可用于执行表达式、类、接口、枚举等。
详细的文档可以在 jshell 中找到,其中包含完整信息,以及使用其内部命令和各种选项的信息。可以使用两个命令访问此文档:“/help”和“/?”。 jshell的文档不仅限于其内部控制的信息,还包括javadoc。
在下面的代码片段中,可以通过使用“ /help”命令。
jshell> /help| type a java language expression, statement, or declaration.| or type one of the following commands:| /list [<name or id>|-all|-start]| list the source you have typed| /edit <name or id>| edit a source entry referenced by name or id| /drop <name or id>| delete a source entry referenced by name or id| /save [-all|-history|-start] <file>| save snippet source to a file.| /open <file>| open a file as source input| /vars [<name or id>|-all|-start]| list the declared variables and their values| /methods [<name or id>|-all|-start]| list the declared methods and their signatures| /types [<names or id>|-all|-start]| list the declared types| /imports| list the imported items| /exit| exit jshell| /env [-class-path <path> ] [-module-path <path>] [-add-modules <modules>] ...| view or change the evaluation context| /reset [-class-path <path>] [-module-path <path>] [-add-modules <modules>]...| reset jshell| /reload [-restore] [-quiet] [-class-path <path>] [-module-path <path>]...| reset and replay relevant history -- current or previous (-restore)| /history| history of what you have typed| /help [<command>|<subject>]| get information about jshell| /set editor|start|feedback|mode|prompt|truncation|format ...| set jshell configuration information| /? [<command>|<subject> ]| get information about jshell| /!| re-run last snippet| /| re-run snippet by id| /-| re-run n-th previous snippet| for more information type '/help' followed by the name of a command or a subject.| for example '/help /list' or '/help intro'.|| subjects:|| intro| an introduction to the jshell tool| shortcuts| a description of keystrokes for snippet and command completion,| information access, and automatic code generation| context| the evaluation context options for /env /reload and /reset
jshell 打印不同的现有内部命令,并快速介绍它们的用途,并访问其使用的更详细说明。为此,我们只需输入命令:“/help”,然后输入详细的命令名称(例如“/set”命令)。jshell> /help /set|| /set|| set jshell configuration information, including:| the external editor to use, the start-up definitions to use, a new feedback mode,| the command prompt, the feedback mode to use, or the format of output.|| /set editor [-wait] ...| specify the command to launch for the /edit command.| the <command> is an operating system dependent string.|| /set start <file>| the contents of the specified become the default start-up snippet s and commands.|| /set feedback <mode>| set the feedback mode describing displayed feedback for entered snippets and commands.|| /set mode <mode>[<old-mode>] -command|-quiet|-delete| create or update a user-defined feedback mode, optionally copying from an existing mode.|| /set prompt <mode>"<prompt>" "<continuation-prompt>"| set the displayed prompts for a given feedback mode.|| /set truncation <mode> <length> <selector> ...| set the maximum length of a displayed value.|| /set format <mode> <field> "<format>" ...| configure a feedback mode by setting the format of a field when the selector matches.|| /set| show editor, start, and feedback settings as /set commands.| to show the settings of any of the above, omit the set value.|| to get more information about one of these forms, use /help with the form specified.| for example: /help /set format
我们需要找到第三部分输入的命令,是否修改jshell的返回(/set feedback),以修改默认编辑器(/set editor),或者修改jshell的启动(/set start)。
jshell> /help /set feedback| set the feedback mode describing displayed feedback for entered snippets andcommands:|| /set feedback [-retain] <mode>|| retain the current feedback mode for future sessions:|| /set feedback -retain|| show the feedback mode and list available modes:|| /set feedback|| where <mode> is the name of a previously defined feedback mode.| you may use just enough letters to make it unique.| user-defined modes can be added, see '/help /set mode'|| when the -retain option is used, the setting will be used in this and future| runs of the jshell tool.|| the form without <mode> or -retain displays the current feedback mode and available modes.
以上就是如何在java 9中获取jshell文档?的详细内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product