====== JShell ====== * [[java:9|Java 9]] 에서 추가된 Java Shell ===== shebang ===== * ''#!'' 형태로 jshell 실행하기 * [[https://gist.github.com/ffissore/012d7e32a096fde5266f49038c93dcaf|with jshell-wrapper you get runnable java scripts: it removes the heading shebang, adds an "/exit" for good measure, and passes the result to jshell]] # 이 내용을 jshell-wrapper로 저장하고 #!/path/to/jshell-wrapper 로 shebang 지정 TMP=`mktemp` tail -n +2 $@ >> $TMP echo "/exit" >> $TMP #$JAVA_HOME/bin/jshell -q --execution local $TMP /usr/bin/env jshell -q --execution local $TMP rm $TMP #put this file in /usr/local/bin/ or somewhere in your $PATH * [[https://bugs.openjdk.java.net/browse/JDK-8167440|[JDK-8167440] jshell tool: support shebang(#!; executable UNIX scripts) - Java Bug System]] shebang 공식 지원에 관한 issue ===== 참조 ===== * [[https://examples.javacodegeeks.com/core-java/java-9-jshell-tutorial/|Java 9 Jshell Tutorial | Examples Java Code Geeks - 2018]] * [[http://taewan.kim/post/trans_jshell/|[번역] JShell 사용자 가이드]] * [[https://www.youtube.com/playlist?list=PLqq-6Pq4lTTZh5EDIPZuaD3S25z49Rodz|JShell Basics Youtube]] * [[https://cr.openjdk.java.net/~rfield/tutorial/JShellTutorial.html|JShell Tutorial]] * [[https://docs.oracle.com/en/java/javase/17/jshell/introduction-jshell.html|Introduction to JShell / Java 17]]