Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running Java 9 jshell in Eclipse [duplicate]

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 ?

like image 258
A_J Avatar asked Jun 02 '26 22:06

A_J


1 Answers

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 followed by Enter

enter image description here

Alternatively, you can use a Scrapbook Page, a built-in feature of the Eclipse Java IDE and which also works with older Java versions. You will have code completion and you can use Java classes of your project:

enter image description here

like image 107
vladul Avatar answered Jun 04 '26 11:06

vladul