jshell

In JShell, how to import classpath from a Maven project

天大地大妈咪最大 提交于 2019-11-27 20:16:14
I have a local Maven project under development. How can I launch jshell with the project class path with all the dependencies, so that I can test project or dependency classes inside JShell. You can use the jshell-maven-plugin: mvn com.github.johnpoth:jshell-maven-plugin:1.1:run which will fire up a JShell session with your project's runtime path. If you want to include your test dependencies just add -DtestClasspath to the command. Source code: https://github.com/johnpoth/jshell-maven-plugin ; contributions are welcome :) full disclaimer: I wrote the plugin. Enjoy! Jianwu Chen I wrote a

Is it possible to use sysout without class and main method in Eclipse IDE using Java 9?

和自甴很熟 提交于 2019-11-27 18:25:04
问题 As Java 9 introduced the concept of JShell which enables us to write code without creating a class and a method, is it possible to use this feature of Java 9 in eclipse ? 回答1: You can use the TM Terminal to run JShell in Eclipse: If necessary, install TM Terminal (contained only in some Eclipse packages) Open a 'Terminal' view in Eclipse: Window > Show View > Other...: Terminal > Terminal Launch a new Local Terminal Run JShell, e. g. on Windows type "C:\Program Files\Java\jdk-9\bin\jshell" -v