DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Related

  • Using Lombok Library With JDK 23
  • A Maven Story
  • Step By Step Guide To Using Mule ESB
  • Using Python Libraries in Java

Trending

  • Driving DevOps With Smart, Scalable Testing
  • Building an AI/ML Data Lake With Apache Iceberg
  • Dropwizard vs. Micronaut: Unpacking the Best Framework for Microservices
  • IoT and Cybersecurity: Addressing Data Privacy and Security Challenges
  1. DZone
  2. Coding
  3. Java
  4. Installing Maven With Your JDK

Installing Maven With Your JDK

Apache Maven remains one of the most popular dependency managers in the world of Java.

By 
John Thompson user avatar
John Thompson
·
Dec. 07, 18 · Tutorial
Likes (11)
Comment
Save
Tweet
Share
94.0K Views

Join the DZone community and get the full member experience.

Join For Free

Apache Maven is distributed in several formats. The simplest way to install Maven is to download a ready-made binary distribution archive and follow the installation instructions. Maven 3.3+ release requires JDK 1.7 or above to execute

General Requirements

  • Java JDK must be installed on your system.
  • Java 1.7 or higher is needed for Maven.

To verify the Java JDK is properly installed, from your command line, run the following command:

jt$ javac --version


You should see:

javac 11


This command verifies that the Java complier (javac) is installed.

If javac is not found, check your Java JDK installation. Maven will not function without it properly installed.

Installing Apache Maven on Windows 10

    1. Download the binary zip archive from a downloaded mirror.  echo %JAVA_HOME% 
    2. Extract the archive to a suitable location.
    3. Add the directory of the extracted Maven directory to the environment variable. The steps to do so on Windows 10 are:
      1. Right-click This PC and select Properties.
      2. On the left pane, select Advance system settings.
      3. Click the Environment Variables button.
      4. In the Environment Variables dialog box that appears, double-click Path under System variables.
  1. In the Edit environment variable dialog box that appears, click the New button.
  2. Add the path to the bin directory of the Maven installation. An example path is C:\apache-maven-3.6.0\bin



  1. Click the OK button.
  2. Click the OK button to close the Environment Variables dialog box.
  3. Finally, click the OK button to close System Properties.
  4. Open a new command prompt window and type the following command.
mvn -v


This command displays the version information. This also verifies that Maven is installed on your computer.

Installing Apache Maven on POSIX Compliant Operating System (Linux and Mac OS X)

To install Maven on a POSIX Compliant Operating System, such as Linux or Mac OS X, perform the following steps:

  1. Ensure JAVA_HOME is set:  echo $JAVA_HOME 
  2. Download the binary archive from a download mirror.
  3. Switch the Maven contents.  mv Downloads/apache-maven* /opt/apache-maven 
  4. Add Maven binaries to the PATH and append.  export PATH=/opt/apache-maven-3.6.0/bin:$PATH 
  5. Open a new terminal window and type this command.  mvn -v 

This command displays the version information and verifies that Maven is installed on your computer.

Apache Maven Java (programming language) Java Development Kit

Published at DZone with permission of John Thompson, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Using Lombok Library With JDK 23
  • A Maven Story
  • Step By Step Guide To Using Mule ESB
  • Using Python Libraries in Java

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!