Oh Java, my old, lousy and boilerplated friend. For ages, trying anything new (which luckily wasn’t that frequent after all) required starting a new project, followed by a Sandbox
class and a public static void main
method. Alternatively, a simple JUnit test was a nice entrypointt as well - if we were lucky enough to have some dependency management sorted out.
Thankfully, things have changed. With the Java9 a REPL has been introduced, everybody can just run an up-to-date Java shell and try out new syntaxt, new APIs, new libraries. Now we can feel like Scala, Clojure, Ruby, JavaScript, PHP, call whatever language developers - finally there.
In this talk I’ll walk through essential REPL examples, see how we can use JShell to try out new language features (like Java 10 var
syntax, Java 9 Streams enhancements), but foremost, we will use it to build a real-life web application. Expect meat-only talk without theory, diagrams, useless "javax.swing.*" application examples.
-
explain jshell
-
show some basic new Java9 features in the shell
-
show shell’s edit function based on exploring regular expressions and walking file trees
-
build a simple web application in shell (with SparkJava)
-
add web application features (web sockets)
-
showcase direct jshell to app communication
-
save the code from the jshell to be able to refactor it within the IDE
-
(optional) cover java9 module as an essential part of jshell environment
-
Learn the new language and libraries
-
Write code with immediate feedback
-
No build or deploy
-
Easy way of creating faithful lies for our test
-
Tools to understand the real world
-
Fewer surprises when starting the application
-
Add new libraries to a running application
-
Run automatically unit test affected by a change
-
Inspect and manage the state
-
Stay in comfort of your favourite IDE
-
Debug staging and production
Connect to jshell remotly, run jshell from the IDE
- General introduction
- JMX Client
-
-
JMX Client: https://github.com/YaSuenag/jmxclient
-
- Netbeans JShell
- Daniel Lebrero - REPL Driven Development
- Robert Field - JShell: An Interactive Shell for the Java Platform
-
-
http://www.slideshare.net/JavaDayUA/jshell-an-interactive-shell-for-the-java-platform
-
repl/_src/kyivjshelluse-160108211449.pptx
- Roy van Rijn - Brace Yourselves, the REPL is Coming
- Interactive Java Support to your tool, Robert Field
-
-
repl/_src/kyivjshelluse-160108211449.pptx
- Articles
- Java9
- Java9 modules