사용자 도구

사이트 도구


java:jshell

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

다음 판
이전 판
java:jshell [2018/07/25 14:26]
kwon37xi 만듦
java:jshell [2022/01/09 16:12] (현재)
kwon37xi [shebang]
줄 2: 줄 2:
   * [[java:9|Java 9]] 에서 추가된 Java Shell   * [[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]]
 +
 +<code sh>
 +# 이 내용을 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
 +</code>
 +  * [[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]]   * [[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]]
  
  
java/jshell.1532496408.txt.gz · 마지막으로 수정됨: 2018/07/25 14:26 저자 kwon37xi