#!/bin/bash
if (test -z "$1"); then
 echo "Parameter 1 is supposed to be the jar name!!! (without .jar, e.g. 'test')";
fi
javac *.java
if (test $? -eq 0 ); then
 echo Main-Class: test > Manifest.txt
 jar cmf Manifest.txt $1.jar *.class;
 if (test $? -eq 0 ); then
  echo "Success, putting result in file $1.jar";
 fi
fi
