This is a project template for a greenfield Java project. It's named after the Java mascot Duke. Given below are instructions on how to use it.
Prerequisites: JDK 21.
- Open IntelliJ (if you are not in the welcome screen, click
File
>Close Project
to close the existing project first) - Open the project into IntelliJ as follows:
- Click
Open
. - Select the project directory, and click
OK
. - If there are any further prompts, accept the defaults.
- Click
- Configure the project to use JDK 21 (not other versions) as explained in here.
In the same dialog, set the Project language level field to theSDK default
option. - After that, locate the
src/main/java/Duke.java
file, right-click it, and chooseRun Duke.main()
(if the code editor is showing compile errors, try restarting the IDE). If the setup is correct, you should see something like the below as the output:Hello from ____ _ | _ \ _ _| | _____ | | | | | | | |/ / _ \ | |_| | |_| | < __/ |____/ \__,_|_|\_\___|
Warning: Keep the src\main\java
folder as the root folder for Java files (i.e., don't rename those folders or move Java files to another folder outside of this folder path), as this is the default location some tools (e.g., Gradle) expect to find Java files.
The project comes with a set of test scripts for different operating systems:
-
MacOS/Linux: Run the shell script
cd text-ui-test ./runtest.sh
-
Windows: Run the batch script
cd text-ui-test runtest.bat
These scripts will compile the source files, run the tests, and compare the output against the expected output.