Search in sources :

Example 6 with JShell

use of jdk.jshell.JShell in project jdk9-jigsaw by AdoptOpenJDK.

the class JShellSample2 method main.

public static void main(String[] args) {
    JShell shell = JShell.builder().build();
    shell.eval("void helloJShell() { System.out.println(\"hello VJUG\"); }");
    shell.methods().forEach(v -> System.out.println("Method: " + v.signature() + " " + v.name()));
}
Also used : JShell(jdk.jshell.JShell)

Example 7 with JShell

use of jdk.jshell.JShell in project jdk9-jigsaw by AdoptOpenJDK.

the class JShellSample6 method main.

public static void main(String[] args) throws Exception {
    JShell shell = JShell.builder().build();
    shell.eval(readFile(JShellSample6.class.getResource("commands.repl").getPath())).forEach(e -> System.out.println(e));
}
Also used : JShell(jdk.jshell.JShell)

Aggregations

JShell (jdk.jshell.JShell)7 SnippetEvent (jdk.jshell.SnippetEvent)4 List (java.util.List)2 VarSnippet (jdk.jshell.VarSnippet)2 FileOutputStream (java.io.FileOutputStream)1 IOException (java.io.IOException)1 PrintStream (java.io.PrintStream)1 Charset (java.nio.charset.Charset)1 Files (java.nio.file.Files)1 Paths (java.nio.file.Paths)1 Application (javafx.application.Application)1 Scene (javafx.scene.Scene)1 Button (javafx.scene.control.Button)1 ListView (javafx.scene.control.ListView)1 TextField (javafx.scene.control.TextField)1 BorderPane (javafx.scene.layout.BorderPane)1 HBox (javafx.scene.layout.HBox)1 Stage (javafx.stage.Stage)1 Snippet (jdk.jshell.Snippet)1