This is a simple starter project for using Greenfoot outside of its dedicated IDE. Since more experience developers might want to use a more powerful IDE. This project is tailored to run in VSCode but should be usable in every Environment where Maven is supported.
To use this project you need to have Maven installed. You can install it via your package manager or download it from the official website.
If you have any problems with the installation, please refer to the official Maven installation guide.
After you have installed Maven do the following:
-
Clone this repository
git clone https://github.com/LeoTuet/greenfoot-maven-starter
-
Open the project in your favorite IDE
-
Install the dependencies
mvn clean install
To run the project use the following command:
mvn clean javafx:run
To debug the project use the following command:
mvn clean javafx:run@debug
#Note: The Greenfoot Window will not open until you attach the debugger
As soon as the project is Running go to the Debug tab in the Activity Bar
and execute the Attach Debugger
. The Greenfoot Window should now open and you can start debugging.
To update the Greenfoot version you just need to swap out the greenfoot.jar
and bluej.jar
in the lib
folder. After that you should update the pom.xml
to the new version.