I wrote this for a final project in Programming Fundamentals II. It's a simple Tic Tac Toe game that plays itself using random numbers and calculates the results. Originally written and compiled using Java 8 from Oracle. Without modification it should compile and run using the latest OpenJDK and Open JavaFX packages.
-
Install Git for Windows
-
Open Git Bash
- Run the following commands to setup envrionment.
cd
git clone https://github.com/clintmint/TicTacToe.git
cd TicTacToe
curl -o openjdk-14.0.1_windows-x64_bin.zip https://download.java.net/java/GA/jdk14.0.1/664493ef4a6946b186ff29eb326336a2/7/GPL/openjdk-14.0.1_windows-x64_bin.zip
curl -o openjfx-14.0.1_windows-x64_bin-sdk.zip https://download2.gluonhq.com/openjfx/14.0.1/openjfx-14.0.1_windows-x64_bin-sdk.zip
unzip openjdk-14.0.1_windows-x64_bin.zip
unzip openjfx-14.0.1_windows-x64_bin-sdk.zip
export PATH=$HOME/TicTacToe/jdk-14.0.1/bin/:$PATH
export PATH_TO_FX=$HOME/TicTacToe/javafx-sdk-14.0.1/lib/
- Verify versions are 14.x
java -version
javac -version
- Compile & Run
javac --module-path $PATH_TO_FX --add-modules javafx.controls TicTacToe.java
java --module-path $PATH_TO_FX --add-modules javafx.controls TicTacToe
- Clone
cd
git clone https://github.com/clintmint/TicTacToe.git
cd TicTacToe
- Install OpenJDK and OpenJFX using package manager then configure openjfx library path.
sudo apt install openjdk-17-jdk openjfx
export PATH_TO_FX=/usr/share/openjfx/lib
- Compile & Run
javac --module-path $PATH_TO_FX --add-modules javafx.controls TicTacToe.java
java --module-path $PATH_TO_FX --add-modules javafx.controls TicTacToe