Download the latest version of objenesis zip file from http://objenesis.org/download.html and copy it onto C:\>EasyMock folder. At the time of writing this tutorial, the latest version was 2.1. Extract objenesis-2.1.jar to C:\>EasyMock folder

Step 5: Set EasyMock Environment

Set the EasyMock_HOME environment variable to point to the base directory location where EasyMock and dependency jars are stored on your machine. The following table shows how to set the environment variable on different operating systems, assuming we've extracted easymock-3.2.jar, cglib-3.1.jar, and objenesis-2.1.jar onto C:\>EasyMock folder.

OS

Output

Windows

Set the environment variable EasyMock_HOME to C:\EasyMock

Linux

export EasyMock_HOME=/usr/local/EasyMock

Mac

export EasyMock_HOME=/Library/EasyMock

Step 6: Set CLASSPATH Variable

Set the CLASSPATH environment variable to point to the location where EasyMock and dependency jars are stored. The following table shows how to set the CLASSPATH variable on different operating systems.

OS

Output

Windows

Set the environment variable CLASSPATH to %CLASSPATH%;%EasyMock_HOME%\easymock-3.2.jar;%EasyMock_HOME%\cglib-3.1.jar;%EasyMock_HOME%\objenesis-2.1.jar;.;

Download the latest version of JUnit jar file from Github. Save the folder at the location C:\>Junit.

OS

Archive name

Windows

junit4.11.jar, hamcrest-core-1.2.1.jar

Linux

junit4.11.jar, hamcrest-core-1.2.1.jar

Mac

junit4.11.jar, hamcrest-core-1.2.1.jar

Step 8: Set JUnit Environment

Set the JUNIT_HOME environment variable to point to the base directory location where JUnit jars are stored on your machine. The following table shows how to set this environment variable on different operating systems, assuming we've stored junit4.11.jar and hamcrest-core-1.2.1.jar at C:\>Junit.

OS

Output

Windows

Set the environment variable JUNIT_HOME to C:\JUNIT

Linux

export JUNIT_HOME=/usr/local/JUNIT

Mac

export JUNIT_HOME=/Library/JUNIT

Step 9: Set CLASSPATH Variable

Set the CLASSPATH environment variable to point to the JUNIT jar location. The following table shows how it is done on different operating systems.

OS

Output

Windows

Set the environment variable CLASSPATH to %CLASSPATH%;%JUNIT_HOME%\junit4.11.jar;%JUNIT_HOME%
\hamcrest-core-1.2.1.jar;.;