0

I noticed that you can easilly use schebang with Java files as described in JEP-330 http://openjdk.java.net/jeps/330#Shebang_files.

I would like to achieve the same but for JShell scripts

#!/usr/bin/jshell

System.out.println("hello");

However when executing it the first line is giving me the following error:

Error:
illegal character: '#'
#!/usr/bin/jshell
^
Error:
illegal start of expression
#!/usr/bin/jshell
  ^

Am I doing something wrong or this is not yet supported for Jshell scripting?

Aleksander Lech
  • 1,105
  • 12
  • 16
  • 1
    https://stackoverflow.com/questions/44916618/how-to-execute-a-java-script-with-jshell – Naman Sep 19 '19 at 18:57
  • I hope the following link helps you to resolve the issue [Please refer the link](https://stackoverflow.com/questions/44916618/how-to-execute-a-java-script-with-jshell) – Prasanth Rajendran Sep 19 '19 at 19:05

0 Answers0