Project for the AP4B class ("Java and UML") The root directory is quite cluttered, sorry about that.
To work on this repository, you will to have git
(or any git client, like Github Desktop) installed, and clone this repository before doing anything:
git clone https://github.com/adri326/ap4b-project/
cd ap4b-project
If you don't need to work on the repository, then you can download the latest zip archive and proceed to the next steps.
You can optionally download and install the gradle
command for your system, but the repository is shipped with scripts that will download and run a version of gradle
for you already.
You will need a version of JDK >= 11 (earlier versions haven't been tested) installed on your system and the JAVA_HOME
environment variable should point to the folder where you installed it.
If you are on Windows, you may then execute the gradlew.bat
script:
gradlew.bat build
If you are on a Unix machine, then execute the gradlew
script:
./gradlew build
If you already have gradle
installed, then you can execute it directly:
gradle build
The gradle
build system should then download the required libraries and start compiling the project, assuming that your JDK was set up correctly.
If no error were encountered during compilation, you can finally run the project (the lines starting with #
are comments and shouldn't be pasted in your terminal):
# On windows:
gradlew.bat run
# On unix:
./gradlew run
# With "gradle" installed:
gradle run
Before jumping to this section, please first follow the steps in Compiling the source code to make sure that you can compile and run the project using gradle!
If you want to use Eclipse for compiling and editing the project, then you will need to run a different command than the above to generate the Eclipse project from the Gradle project:
# On windows:
gradlew.bat eclipse
# On unix:
./gradlew eclipse
# With "gradle" installed:
gradle eclipse
A .project
file will be generated in the app/
directory; open it in Eclipse and you'll be good to go!
If changes were made on the Gradle configuration files, then run the above command after running ./gradlew cleanEclipse
(or gradlew.bat cleanEclipse
on Windows).
If you get the following error: Error: JavaFX runtime components are missing, and are required to run this application
, then you may try the following instead:
Delete the project from the workspace and run gradlew cleanEclipse
, then in Eclipse, do Import projects
> Gradle
> Existing Gradle Project
.
You shouldn't need to change any of the settings and you can press Finish
.
Two packages will appear: one labeled ap4b-project
, which only contains the configuration files for gradle
and app
, which contains the source code of the project.
The source files are nested in the src/main/java
> ap4b.project
directories, make sure that they are here!
Finally, open the drop-down next to the "Run" button, and choose ap4b-project - run
.
Later, it should appear first in the drop-down and pressing the "Run" button will run it directly.
This will call gradlew run
and, assuming that you were able to complete the Compiling the source code section, you should see a window appear with the game running.
Because JavaFX was removed from the JDK, it is now exponentially harder to compile the code as a jar file.
You will have to somehow download a version of JavaFX yourself. On arch linux, you only need to install java-openjfx
or java11-openjfx
.
Then, run gradle jar
to compile the code as a JAR.
To run the .JAR, you will have to use the following command:
java --module-path /usr/lib/jvm/java-11-openjfx/lib --add-modules="javafx.controls" -jar app/build/libs/ap4b.project-1.0.0.jar
Replace the path after --module-path
with wherever you installed JavaFX (it does need to be the lib
subdirectory).
Github unfortunately does not have a "download file" button, so you will need to either download the entire repository or use one of the handy links here:
uml-sequence-1.drawio
uml-sequence-2.drawio
uml-sequence-3.drawio
uml-sequence-4.drawio
uml-classes.drawio
uml-communication.drawio
uml-usecases.drawio
Description textuelle.odt
For .drawio
files, you can download draw.io desktop and open it with it, or simply go to draw.io, choose to save diagrams to the Device
and then open the file that you downloaded.