We have seen REPL (Read-Eval-Print Loop) in lots of languages like Scala, Python, Ruby, Haskell etc. but, orginates from LISP.
This feature really helps in rapid testing and learning the language. Java needed one such and so, in Java 9, we can expect this.
Refer here : The Java Shell (Read-Eval-Print Loop) as Project Kulla
However, if you would like to try REPL for Java 6+, you can give this a try - java-repl by Albert Latacz
The above two are pretty much the same! While the first one is when you would like to import third party libraries and the latter is a feature support that you would like to give, on your project, to your developers - more like using APIs.
Importing Other Projects
You need to add javarepl.jar and the path to third party jars (mostly in lib directory) to your classpath and execute as below.
where ${CLASSPATH} can be javarepl.jar:path_to_jar_1:path_to_jar_2: . . . :path_to_jar_n
REPL Support For Your Project
If you need a managed way to invoke a REPL environment without the hassle of CLASSPATH, you can tweak this script ( mostly two parameters per your needs YOUR_PROJECT_DIR and YOUR_PROJECT_BUILD_DIR.