Is there something like python's interactive REPL mode, but for Java?

前端 未结 28 1259
一个人的身影
一个人的身影 2020-11-29 16:38

Is there something like python\'s interactive REPL mode, but for Java? So that I can, for example, type InetAddress.getAllByName( localHostName ) in a window, a

28条回答
  •  情书的邮戳
    2020-11-29 16:54

    It's part of OpenJDK 9!

    A REPL called JShell (developed by Oracle) has been released as part of JDK 9.

    Just download JDK 9, and launch bin/jshell.

    Resources

    • blogs.oracle.com: Inside JShell
    • DZone: Java 9 (Part 2): JShell Step by Step
    • OpenJDK project Kulla
    • Java Enhancement Proposal, JEP 222: jshell: Java Shell (Read-Eval-Print Loop)

提交回复
热议问题