0% found this document useful (0 votes)
31 views4 pages

DPA Exp1.3

This document provides instructions for installing and configuring the Java Development Kit (JDK) and Apache Maven on Windows. It outlines downloading and extracting the JDK and Maven, setting the JAVA_HOME and PATH environment variables to locate them, and verifying the installations. It then gives an example of using Maven commands to create, build, test, and run a simple Java project. The learning outcomes are installing and configuring JDK and Maven, using Maven for project management and builds, and verifying successful installations.

Uploaded by

uic.19bca1345
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views4 pages

DPA Exp1.3

This document provides instructions for installing and configuring the Java Development Kit (JDK) and Apache Maven on Windows. It outlines downloading and extracting the JDK and Maven, setting the JAVA_HOME and PATH environment variables to locate them, and verifying the installations. It then gives an example of using Maven commands to create, build, test, and run a simple Java project. The learning outcomes are installing and configuring JDK and Maven, using Maven for project management and builds, and verifying successful installations.

Uploaded by

uic.19bca1345
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

DEVOPS PROCESS AUTOMATION LAB

Worksheet -1.3
Subject code: 22CAP-745

Student Name: ANSHUMAN UID:22MCC20125


Section/Group: 22MCD-2/B Semester:3rd
Date of Performance:

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.

1. Install JDK (Java Development Kit):


• The JDK provides tools, executables, and libraries necessary for Java development.
• Visit the Oracle JDK download page or the OpenJDK website.
• Choose the appropriate JDK version for your operating system (Windows, macOS, or
Linux).
• Download and run the installer.
• Follow the installer's instructions to complete the installation.

2. Set JAVA_HOME Environment Variable:


• After installing the JDK, it's important to set the ‘JAVA_HOME’ environment variable to
point to the JDK installation directory.

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:

1. Download Apache Maven:


• Visit the official Apache Maven website: https://maven.apache.org/
• Navigate to the "Download" section.
• Download the latest version of Apache Maven (a ‘.zip’ or ‘.tar.gz’ archive) from the
"Files" column.

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."

3. Set Environment Variables:


• Add Maven to your system's PATH environment variable to allow you to use Maven
from any command prompt or terminal window.

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’).

Adding a new Variable (System/User):


• To add a new variable, select either "System variables" or "User variables" (based on
your preference).
• Click the "New" button.
• Enter the variable name in the "Variable name" field (e.g., ‘MAVEN_HOME’).

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:

1. Create a new Maven Project:


Open Command Prompt and create an example project using this command:

“mvn archetype:generate -DgroupId=com.example


-DartifactId=my-maven-project
-DarchetypeArtifactId=maven-archetype-quickstart
-DinteractiveMode=false”

2. Navigate to the project directory:

3. Clean and Build the Project:


The ‘clean’ goal removes the target directory containing compiled classes and artifacts from
previous builds. The ‘install’ goal compiles and packages your project.

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.

Learning outcomes (What I have learnt):


• Installation of JDK and Apache Maven on Windows.
• Configure the ‘JAVA_HOME’ environment variable for resource accessibility.
• Utilize Apache Maven for efficient project management and builds.
• Integrate Maven's ‘bin’ directory into the system's ‘PATH’.
• Verify successful installations through version checks.

You might also like