Code Monkey home page Code Monkey logo

java-mod-5-installing-maven's Introduction

Installing Maven

Learning Goals

  • Install Maven on your machine.

Introduction

Maven can be installed manually or by using a package manager tool like brew (Mac). We’ll first walk through the manual installation process where we download the archive from the Maven website and add the executable to our PATH.

Manual Installation

Here are the steps we’ll follow:

  • Download and extract the bin archive.
  • Add Maven to our PATH.

Getting the Maven Archive

Add Maven to PATH

The bin file in the extracted folder is used to run Maven. If we add this file’s path to our PATH variable, we’ll be able to use the mvn command from anywhere on our machine.

For Windows, run the following command:

setx path "%path%;c:\developer\apache-maven-3.8.6\bin"

For Mac, run the following commands:

export PATH="~/developer/apache-maven-3.8.6/bin:$PATH"
source ~/.zshrc

Installing with Brew (Mac)

We can also use Homebrew to install Maven on our machine.

brew install maven

Testing Maven Installation

If the above steps worked, you should be able to access the mvn command from your command line or terminal. Run the following command to check if it was installed.

mvn -version

You should get an output like this:

Apache Maven 3.8.5 (3599d3414f046de2324203b78ddcf9b5e4388aa0)
Maven home: /opt/homebrew/Cellar/maven/3.8.5/libexec
Java version: 17.0.2, vendor: Homebrew, runtime: /opt/homebrew/Cellar/openjdk/17.0.2/libexec/openjdk.jdk/Contents/Home
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "12.3.1", arch: "aarch64", family: "mac"

This particular machine is running 3.8.5 but yours should list 3.8.6.

Conclusion

Now that we have a working Maven installation on our machine, we will look into creating projects with Maven and understanding the core concepts in the next lessons.

java-mod-5-installing-maven's People

Contributors

alveem avatar linda-seiter avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.