# Example taken from here: #http://stackoverflow.com/questions/1238145/how-to-run-a-jar-file cat << 'EOF' > Test.java public class Test { public static void main(String[] args) { System.out.println("Hello world"); } } EOF cat << 'EOF' > manifest.mf Manifest-version: 1.0 Main-Class: Test EOF # Compile javac Test.java jar cfm test.jar manifest.mf Test.class # Execute and you should see "Hello world" java -jar test.jar # Clean up # rm -f Test* manifest* test.jar hs*er* #EOF