Have you ever tried to use Java interactive with the upcoming JShell? If no, take a look into my former blog . Today I’m going to write about using the Java shell together with NetBeans.JShell offers a command to change the default editor. And you may change this to run NetBeans to edit code snippets. Using a NetBeans nightly (development) version, this might be set like this:
/set editor /home/mmueller/netbeans-dev-201606020002/bin/netbeans
You have to adapt the path to you current one. No, if you want to edit your code snippets using the /edit command invokes NetBeans. You’re able to edit the snippet, and on save, this will be executed within the Java shell. If you terminate NetBeans, the control is shifted back to jshell.
If NetBeans is already running when you invoke the shell’s edit command, then the snippet will be shown within NetBeans, but all changes are ignored. It seems, jshell observes file changes only, if the editor is launched from within jshell (this happens also to other editors like gedit).
The real cool stuff is to start jshell from the NetBeans terminal window:
(The screenshot is taken from Ubuntu. Using Windows, there is a display issue )
This allows you to exchange data by copy and paste within the NetBeans workspace. And after invoking /edit you can use the clipboard functions, too.