Skip to content

Latest commit

 

History

History
 
 

session1

Session 1 Exercises

Java build and test exercises and some Java revision

These exercises will help you appreciate what maven does to help you build a java project.

Before you do anything, you should ensure that you have maven installed correctly and can open a windows command prompt with the correct class path.

Open a cmd.exe window or a powershell and try

mvn -version
javac -version
java -version

If any of these commands does not work, you do not have the correct maven and java installation on your machine. Please go through the seperate instructions to get your machine set up correctly.

( DEPRICATED: If you are on a university machine which does not have maven installed all is not lost since we can do a temporary install using the instructions and script in maven-setup

If you use maven-setup. Keep the command prompt open and CD to the correct folder to use this command prompt to run the build commands in these exercises ).

Exercises

  1. First try the command-line-exercise to help you appreciate what manually compiling and running java code entails.

  2. Then look at the maven-test-exercise to understand what maven does for you.

  3. Finally try the revisionCOM405. This exercise will help you revise the final weeks of COM405 Introduction to OOD / Java and introduce UML, Testing and maven. The answer to this exercise is here revisionCOM405Answer but dont look at it until you have tried your own.