Java Generics – Environment Setup

Java Generics - Environment Setup

This topic is about Java Generics – Environment Setup.

Local Environment Setup

JUnit is a framework for Java, so the very first requirement is to have JDK installed in your machine.

System Requirement

JDK1.5 or above.
MemoryNo minimum requirement.
Disk SpaceNo minimum requirement.
Operating SystemNo minimum requirement.

Step 1: Verify Java Installation in Your Machine

First of all, open the console and execute a java command based on the operating system you are working on.

OSTaskCommand
WindowsOpen Command Consolec:\> java -version
LinuxOpen Command Terminal$ java -version
MacOpen Terminalmachine:< joseph$ java -version

Let’s verify the output for all the operating systems −

OSOutput
Windowsjava version “1.6.0_21″Java(TM) SE Runtime Environment (build 1.6.0_21-b07)Java HotSpot(TM) Client VM (build 17.0-b17, mixed mode, sharing)
Linuxjava version “1.6.0_21″Java(TM) SE Runtime Environment (build 1.6.0_21-b07)Java HotSpot(TM) Client VM (build 17.0-b17, mixed mode, sharing)
Macjava version “1.6.0_21″Java(TM) SE Runtime Environment (build 1.6.0_21-b07)Java HotSpot(TM)64-Bit Server VM (build 17.0-b17, mixed mode, sharing)

If you do not have Java installed on your system, then download the Java Software Development Kit (SDK) from the following link https://www.oracle.com. We are assuming Java 1.6.0_21 as the installed version for this tutorial.

Step 2: Set JAVA Environment

Set the JAVA_HOME environment variable to point to the base directory location where Java is installed on your machine. For example.

OSOutput
WindowsSet the environment variable JAVA_HOME to C:\Program Files\Java\jdk1.6.0_21
Linuxexport JAVA_HOME = /usr/local/java-current
Macexport JAVA_HOME = /Library/Java/Home

Append Java compiler location to the System Path.

OSOutput
WindowsAppend the string C:\Program Files\Java\jdk1.6.0_21\bin at the end of the system variable, Path.
Linuxexport PATH = $PATH:$JAVA_HOME/bin/
Macnot required

Verify Java installation using the command java -version as explained above.

In this topic we learned about Java Generics – Environment Setup. To learn more, Click Here.

Leave a Reply