According to the jshell documentation:
An alternative to editing at the command prompt is to use an external editor. This editor can be used to edit and create snippets, and is especially helpful for multiline snippets. You can configure JShell to use the editor of your choice.
So to implement this, i use the following commands:
jshell> /set editor sublime
| Editor set to: sublime
And then, i tried to edit a snippet as follows:
jshell> /edit printName
| Edit Error: process IO failure: Cannot run program "subllime": error=2, No such file or directory
But, i got the above error. So is it the right way to set editor or something else is required? I also tried to set Microsoft Word as the editor and specified the exact application path from the Application folder of Mac as follows:
jshell> /set editor /Users/karan.verma/Applications/Microsoft Word.app
| Editor set to: /Users/karan.verma/Applications/Microsoft Word.app
Even, when i set the editor as "atom", i got the same results:
jshell> /set editor atom
| Editor set to: atom
But still it shows the same error. Any help?