Code Monkey home page Code Monkey logo

ap4b-project's Introduction

ap4b-project

Project for the AP4B class ("Java and UML") The root directory is quite cluttered, sorry about that.

Installing and running

Grabbing the source code

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.

Compiling the source code

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

Working with Eclipse

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:

Working with Eclipse - alternate version

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.

Compiling and running as a .JAR file

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).

Editing the UML files

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:

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.

ap4b-project's People

Contributors

adri326 avatar jiangyiwe avatar otchappi avatar taragam21 avatar

Watchers

 avatar

Forkers

jiangyiwe

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.