DPA Exp1.3
DPA Exp1.3
Worksheet -1.3
Subject code: 22CAP-745
Aim: Installation and configuration of the JDK (Java Development Kit) and Apache Maven.
Objective: To familiarize with the installation and configuration process of JDK and
Apache Maven We are going to use the following essential steps.
On Windows:
• Right-click on "This PC" or "Computer" and select "Properties."
• Click on "Advanced system settings" on the left.
1
• In the System Properties window, click the "Environment Variables" button.
• Under "System variables," click "New."
• Enter ‘JAVA_HOME’ as the variable name.
• Enter the path to your JDK installation directory (e.g., ‘C:\Program Files\Java\jdk-19’)
as
the variable value.
• Click "OK" to save.
To install and configure Apache Maven on Windows system, follow these steps:
2. Extract Maven:
• Locate the downloaded archive on your system and extract it to a directory of the
program file folder in C: drive. This directory will be referred to as the "Maven Home."
On Windows:
• Right-click on "This PC" and select "Properties."
• Click on "Advanced system settings" on the left.
• Click on the "Environment Variables" button.
• Under "System variables," find and select the "Path" variable, then click "Edit."
• Add a new entry with the path to your Maven bin directory (e.g., ‘C:\Program
Files\apache-maven-3.9.4-bin\apache-maven-3.9.4\bin’).
2
• Enter the variable value in the "Variable value" field (e.g., ‘C:\Program
Files\apachemaven-3.9.4-bin\apache-maven-3.9.4’).
• Click "OK" to close the dialog.
Verify your Maven installation by this command in the Command Prompt:
Example of creating a simple Java project using Maven commands and testing it:
3
4. Compile the Project:
If you only want to compile the project without packaging it:
5. Run Tests:
The ‘test’ goal runs the tests in the project.