Using JShell in NetBeans

Using Java 9s JShell today with Java 8 in NetBeans IDE
December 19, 2016 by Michael

With Java 9 comes JShell, the first official Java Read-Eval-Print-Loop (REPL). The Takipi blog has a nice article out, just in case you don’t know nothing about it. Read it here: Java 9 Early Access: A Hands-on Session with JShell – The Java REPL.

I’m gonna show you today a short screen cast using the current nightly build from the free and Open Source IDE NetBeans. NetBeans allows to run JShell not only with JDK 8 but also agains an opened Maven project, containing all the dependencies from your POM file and the classes of your project.

The first part is a recap what JShell REPL is all about. In the second part, I’m gonna use my DOAG 2016 project. The project is a database centric project using jOOQ for creating database queries.

I’m gonna open up a JDBC connection to a local Oracle Database and execute some queries, from really simple ones to the ones I used in this talk:

What is it good for? In this case I can design complex database queries, try them out, having all the NetBeans features and tools at hand without going through a save / compile / reload whatever cycle. The NetBeans nightly has a lot of rough edges, sure, but you see the potential here.

I also tried starting up Springs application context, but that didn’t work for me yet. That would also incredible useful, especially in regard to generated Spring Data repositories.

No comments yet

Post a Comment

Your email is never published nor shared. Required fields are marked *