How to run a JShell File?

前端 未结 7 921
借酒劲吻你
借酒劲吻你 2020-12-19 00:08

I\'d like to run an entire file with JShell like:

$ jshell my-jshell-skript.java

Where e.g. the content of my my-jshell-skript.java

相关标签:
7条回答
  • Pipe usage can be achieved with the "hyphen" option, absent in the initial jshell release.

    echo 'System.out.print(1 + 2)' | jshell -
    

    https://docs.oracle.com/en/java/javase/11/tools/jshell.html
    https://bugs.openjdk.java.net/browse/JDK-8187439

    0 讨论(0)
提交回复
热议问题