In the "Executing as a Shebang File" section of the "Launching Simple Source-Code Programs" tutorial the following sample code is presented:
#!/path/to/your/bin/java --source 25
public class HelloJava {
public static void main(String[] args) {
IO.println("Hello " + args[0]);
}
}
with the following run instructions
As the sample code expects an command argument to be provided, it will result in the following runtime error:
$ ./HelloJava
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
at HelloJava.main(HelloJava:6)
I suggest:
- Replacing the sample code with a simple "Hello world" one
- Fixing the program run instructions to have a command argument available.