Final Project of CS year 1 (Database, graphs, stats, and JavaFX app that uses everything)
Notion : https://darkened-message-974.notion.site/SAE-V-los-de-Nantes-bc61fe047f6b487cb222b0a5f01e18cd?pvs=4
- Download and install MySQL (8.0.33 as we write this). Server, Workbench, Shell and Connector/J are needed for this app, other products aren't mandatory
- Go in the MySQL Shell and run the following :
\connect root@localhost
\sql
CREATE DATABASE bd_velos_nantes;
\use bd_velos_nantes
\source SAE_creation.sql
\source SAE_remplissage_Quartier_Compteur_Date.sql
\source SAE_remplissage_Comptage.sql
ALTER TABLE Quartier CHANGE longeurPisteVelo longueurPisteVelo FLOAT;
CREATE USER admin@localhost IDENTIFIED BY 'mdp_admin';
CREATE USER user@localhost IDENTIFIED BY 'mdp_user';
GRANT ALL PRIVILEGES ON bd_velos_nantes.* TO admin@localhost WITH GRANT OPTION;
GRANT SELECT ON bd_velos_nantes.* TO user@localhost;
SQL files :
- Go in 2 - Java/2 - Code/Final and open a terminal there. Java JDK 20 have to be installed !! Not tested on prior versions
- Linux :
chmod +x run.sh && ./run.sh
(it seems that the class can't be found...) - Windows :
- CMD :run.bat
- PowerShell :.\run.bat
Alternatively, open that folder in VS Code (Ctrl + K, Ctrl + O), get Java JDK 20 installed, and edit the module path in.vscode/launch.json
to the /lib folder
Then go on Run and Debug tab, and F5
cd ws && jar cfm CycloNantais.jar ../manifest/Manifest.txt -C ../ .
(remove any file directly on ./ before packing)
Then, move the folders back and put the newly created JAR from /ws to the root directory
java --module-path "./lib" --add-modules javafx.controls,javafx.fxml,javafx.graphics,javafx.media,javafx.web,com.google.gson,com.jfoenix --enable-preview --add-exports javafx.graphics/com.sun.javafx.scene=ALL-UNNAMED --illegal-access=permit --add-opens javafx.graphics/com.sun.javafx.scene=com.jfoenix -cp "./CycloNantais.jar;class" frontend.Accueil
java
: Uses java executable to start it. Java 20 needed--module-path
: Specify where the.jar
modules are"./lib"
: They are in thelib
folder relative to the app's root directory--add-modules
: Specify which modules we want to add dufing the app launchjavafx.controls,javafx.fxml,javafx.graphics,javafx.media,javafx.web,com.google.gson,com.jfoenix
: Adds someJavaFX
modules (FXML
is probably not needed),JFoenix
for Material Design andGSON
by Google to handle JSON files--enable-preview
: Allows Java preview features to be enabled. Is also needed for weird reasons to launch it through the command line--add-exports
: Allows exporting of a package from a module to another modulejavafx.graphics/com.sun.javafx.scene=ALL-UNNAMED
:com.sun.javafx.scene
can be exported fromjavafx.graphics
to any other module without restrictions--illegal-access=permit
: Permits illegal access to internal/non-public Java APIs. Deprecated starting from Java 17, this is why we have the next option--add-opens
: Allows opening a package from a module to another module for reflective accessjavafx.graphics/com.sun.javafx.scene=com.jfoenix
:com.sun.javafx.scene
is opened fromjavafx.graphics
tojavafx.graphic
-cp
: Specifies the classpath for the application"./CycloNantais.jar;class"
: Takes as input theclass
directory from theCycloNantais
JAR file located in the app's root directoryfrontend.Accueil
: The entry point of that Java application is theAccueil
class from thefrontend
package