BlackJack Simulator
Synopsis: This application allows the user to run a BlackJack simulator.
Deploying The Application as a Jar in Unix/Linux based systems:
- Download the provided zip file and unzip it's contents
- Create a parent directory called Development/ in your home directory and add a subdirectory called blackJack
mkdir ~/Development
mkdir ~/Development/blackJack
- Navigate to your new project directory
cd ~/Development/blackJack
- Copy the
src
directory for the Java source code from your Downloads directory into the blackJack directory e.g.cp -R ~/Downloads/src ~/Development/blackJack
- Create a build directory to house our binaries
mkdir build
- Prior to compiling our classes let's add our
com.palwell.games.utils
package to our class path. TypeCLASSPATH=.:~/Development/blackJack/src/
in the console and thenexport CLASSPATH
. Runningecho $CLASSPATH
should reveal the class path we just configured. - Compile our utility classes and place the class files in our build directory by running
javac -d build/ src/com/palwell/games/util/*.java
- Compile our driver and place the class files in our build directory by running
javac -d build/ src/com/palwell/games/*.java
- Create a distribution directory for the java archive (JAR) file we are about to make
mkdir dist
. - Navigate to our build directory
cd build
- Create a manifest file in our build directory so the compiler knows where our driver (main class) lives
vi manifest.txt
. Add the following entryMain-Class: com.palwell.games.BlackJack
. Be sure to hit return after the line as the java CLI tools will expect a carriage or newline character at the end of the line. - Now that we have a manifest file we can run
jar -cfmv ~/Development/blackJack/dist/blackJack.jar manifest.txt com/palwell/games/
to create an executable jar. - You should now be able to run the application by submitting the following command
java -jar ~/Development/blackJack/dist/blackJack.jar
.