We recommend that you use IntelliJ IDEA for the assignments, however, you do not have to. If you do, the standard settings that result from following the IntelliJ Project Setup Guide should make your project work with our testing environment.

If you do not want (or cannot) use IntelliJ IDEA, or if you want to make sure you can run your program like our automated testing framework, you first need to download the JUnit 5 Standalone jar-file. Put it in a path you can easily access. You can put it in your library folder, similar to the Functional Java Library jar-file, but do not add it to your IntelliJ project if you have already added JUnit 5 via the standard steps (using Maven).

Then, in your terminal, go to the root directory of your repository, and (replacing the paths to the jar files appropriately) run the following to compile:

# generate output directories (if the don't already exist)
mkdir out
mkdir out/production
mkdir out/production/comp6710-2025s1-p3
mkdir out/test
mkdir out/test/comp6710-2025s1-p3
# go to src folder and compile your java files there 
# NOTE: replace "/path/to/junit-platform-console-standalone-1.9.0.jar" with actual path to that jar-file
# NOTE: replace "/path/to/comp1110lib.jar" with actual path to that jar-file
cd src
javac -cp /path/to/junit-platform-console-standalone-1.9.0.jar:/path/to/comp1110lib.jar --enable-preview --source 23 -d out/production/comp6710-2025s1-p3 *.java
## go to tests folder and compile the tests
# NOTE: replace "/path/to/junit-platform-console-standalone-1.9.0.jar" with actual path to that jar-file
# NOTE: replace "/path/to/comp1110lib.jar" with actual path to that jar-file
cd ../tests
javac -cp /path/to/junit-platform-console-standalone-1.9.0.jar:/path/to/comp1110lib.jar:../out/production/comp6710-2025s1-p3 --enable-preview --source 23 -d out/test/comp6710-2025s1-p3 *.java
## go back to root folder
cd ..

These are essentially the steps that IntelliJ follows to compile your program.

The -cp argument of javac (and java) indicates that the following argument describes the classpath. The classpath is a colon-separated list of paths to either folders or jar-files, which contain classes that your code refers to. In our case, we refer to the junit libraries by pointing to the jar-file you downloaded above and to the Functional Java Standard Library in comp1110lib.jar. The tests additionally rely on the classes in the out folder, which at that point you have already compiled. Because we want to enable you to use parts of Functional Java that you have been used to sometimes, our testing framework still uses the --enable preview --source 23 arguments. In most cases, you should be able to omit them now.

Now, you should be able to run your main classes and tests from the root directory of your repository, like so:

# NOTE: replace "/path/to/junit-platform-console-standalone-1.9.0.jar" with actual path to that jar-file
# NOTE: replace "/path/to/comp1110lib.jar" with actual path to that jar-file
java -cp /path/to/junit-platform-console-standalone-1.9.0.jar:/path/to/comp1110lib.jar:out/production/comp6710-2025s1-p3:out/test/comp6710-2025s1-p3 --enable-preview [your-main-file] [any-arguments-to-your-program...]

Here, the class-path argument points to both libraries, and to the classes contained in the subfolders of out. This way, you can start any of your tests or main functions, by simply naming the class that contains the main function or tests. Again, in most cases, you should be able to omit the --enable-preview argument.

bars search caret-down plus minus arrow-right times