In Unix (or Linux), if I want to run a shell script, I can start the file with #!/bin/sh
. With awk
, I start the executable file with #!/usr/bin/awk -f
and it treats the rest of the file as the program.
How do I do that with a Java program? I tried copying the simple.class
to simple
, putting #!/export/appl/Mail/java/bin/java
at the top and making the file executable, but I get:
69> ./simple
Error: Could not find or load main class ..simple
I know this can be done with an executable shell script, or a C program that execs the java interpreter. Every other interpreter on Unix can be called with a #!
load card, surely there's a way to do it with Java.