Code: Alles auswählen
#!/bin/bash
# Author R.Mertyn
# Date 12.11.2009
# Define varibles:
# SRC --> Full Path to directory with *.java files
SRC="./src"
# BIN --> Please don't change this one
BIN="./bin"
# ROOT_PACKAGE --> Root packeage of your program
ROOT_PACKAGE="package"
# MAIN_CLASS --> A class that contain main() procedure
MAIN_CLASS="Main"
# CLASSPATH --> You should use it you have used a extern library
CLASSPATH=""
# OPTIONS --> You should define JVM options here. You could use some already defined
# variables, like example below
OPTIONS="-Djava.rmi.server.codebase="$BIN
if [ ! -e $BIN ]
then
mkdir $BIN
javac -d $BIN $SRC"/"$ROOT_PACKAGE"/*.java"
fi
cd $BIN
# Create command parameter
if [ $ROOT_PACKAGE!="" ]
then
COMM=$ROOT_PACKAGE"."$MAIN_CLASS
else
COMM=$MAIN_CLASS
fi
java -cp $CLASSPATH $ROOT_PACKAGE.$MAIN
#echo java -cp $CLASSPATH $OPTIONS $COMM #DEBUG