제이셸
JShellJShell은 JDK 9에서 처음 도입된 자바 읽기-평가-프린트 루프다.[1]JEP 222 jshell에 의해 추적된다. Java Shell(Read-Evaluation-Print Loop).[2]JShell이 Java 9에 제안된 이유 중 하나는 이 언어를 위한 표준 인터랙티브 환경의 부족이다; 자바 RET를 사용하기 위한 사실상의 라이브러리는 종종 BeanShell이었고 2003년 이후 휴면 상태였으며 임의적으로 자바 언어로부터 분리되었다.[3][4]
예
jshell> int a[] = {0,1,3,5,8} a ==] int[5] {0, 1, 3, 5, 8 }jshell} int fact(n){...} return n<2?1:n*fact(n-1); ...> } {method fact(int) jshell} for (in i=0; i<a.length ; ++i) ...에 대해 method fact(int) jshell} 생성.> a[i] = 사실(a[i]; jshell) a === 인트[5] { 1, 1, 6, 120, 40320 }
참고 항목
참조
- ^ "Oracle Announces Java SE 9 and Java EE 8". Oracle Corporation. 2017-09-21. Retrieved 2017-09-25.
- ^ "JEP 222: jshell: The Java Shell (Read-Eval-Print Loop)". Oracle Corporation. 2016-10-10. Retrieved 2016-11-01.
Provide an interactive tool to evaluate declarations, statements, and expressions of the Java programming language, together with an API so that other applications can leverage this functionality
- ^ "JEP 222: jshell: The Java Shell (Read-Eval-Print Loop)". Oracle Corporation. 2016-10-10. Retrieved 2016-11-01.
Another alternative is to maintain the status quo: Use another language or use a third-party REPL such as BeanShell, though that particular REPL has been dormant for many years, is based on JDK 1.3, and makes arbitrary changes to the language.
- ^ "JShell, the Java 9 REPL – What does it do?". jaxenter.com. 2015-09-03. Retrieved 2016-11-01.
BeanShell (just like Groovy, too by the way) made an attempt of standardisation by the Java Community Process in JSR 274 – a JSR that did not produce any notable output, in spite of the fact that (or perhaps because?) two major companies, Sun and Google, had joined the expert group. Under the JCP.next initiative this JSR was declared “Dormant”.