In my last blog [1], I showed, how to use the upcoming Java Shell within a NetBeans terminal window. By now, this is fine using Linux. Using Windows, you need to install cygwin to run a terminal window, because the native windows prompt is not supported yet. And launching JShell within the NetBeans (cygwin) terminal still has a display issue. Today I tried an alternative: The Java Platform Shell.The Java Platform Shell is available within the prototypes-repl build [2]. Its in an early state and yet not included within the nightly builds. Unlike the JShell which is available as part of the JDK9, you can run NetBeans Java Platform Shell with Java 8. Even more, currently this is more stable than running NetBeans with Java 9 as default platform.
Of course, there is still a lot of development to do. For example, NetBeans displays some errors (red balls in the image), even though the statements are ok. Another construction area is code completion. Whilst JShell offers a code completion by Tab, this key will repeat the last statement, deleting the current line. Hopefully, the NetBeans team implements a fully fledged autocompletion comparing to that in the Java editor. I believe, they’ll do a great job.
I’m eagerly awaiting the next build. And you may try this feature too.
Enjoy!
[1] blog.mueller-bruehl.de/netbeans/cool-stuff-netbeans-and-jshell
[2] deadlock.netbeans.org/job/prototypes-repl
Do you want to support this blog? You may help to finance the needed hardware.
Want to read more about software development? Purchase one of my books:
Start application development with Java. Learn development foundation, quality control and more.
A Journey through Java EE Technologies whilst developing Web Applications with JavaServer Faces.
Java Lambdas and Parallel Streams
The compact starter: Foundation, supporting structures, parallel processing
No software development, just nature:
A photographic image book. Get it for free. Or pay whatever you like.
Hi Michael,
I stumbled on even a better way to do that ? (although you need java 8 and you might need to favour javascript to beanshell.
see this: https://github.com/lorenzoongithub/nudge4j
Hi Valere,
Looks nice. But what, if you want to query some code which is not include to Java, e.g. your own jars or third party libs?