Skip to content
Technology News Information & Jobs

Technology News Information & Jobs

Ubuntu Tutorials, Ubuntu How To , Linux Tips, Tech Jobs

  • Work with US
  • Search Jobs
  • Post a Job
  • Contact Us
  • Ubuntu
    • Ubuntu 18.04
  • Ubuntu 20.04
  • Ubuntu 22.04
  • Themes
  • Linux
  • Laptops
  • Tutorials
  • Job Dashboard
  • Toggle search form
How To Fix “mvn command not found” Error

How To Fix “mvn command not found” Error

Posted on August 10, 2022 By admin

How To Fix “mvn command not found” Error

You have to deal with this error “mvn command not found” error while trying to invoke the maven utility in Unix systems. Don’t worry we are here with the solutions for this error.

How To Fix “mvn command not found” Error

Before jumping into the solutions, let’s have a look into the possible cause for the “mvn command not found” error.

  • Apache Maven Not Installed on Target System
  • Missing Environment Variables

Now, let’s have a look at the solutions:

Solution 1:

One of the most common reasons for the “mvn command not found” error is  Apache Maven is not being installed on your system. To fix this, you can install Apache Maven on your system.
Run the following command to update your system and install Apache Maven:

sudo apt-get update
sudo apt-get upgrade

Next, install Maven by running the following apt command:

sudo apt-get install maven -y

Solution 2:
Another most common reason for the “mvn command not found” error is the missing environment variables. It is compulsory to set up the necessary environment variables; otherwise, you need to deal with errors.

To set up the environment variables, you need to navigate into the /etc/profile.d/ directory and create a file called maven.sh:

cd /etc/profile.d/
sudo touch maven.sh

After creating file, You need edit the file with your favorite text editor and add the following details:

export JAVA_HOME=/usr/lib/jvm/default-java

export MAVEN_HOME=/home/maven/

export M2_HOME=/home/maven/

export PATH=${M2_HOME}/bin:${PATH}

Note: You need to replace the JAVA_HOME with the path to your JDK installation and MAVEN_HOME, and M2_HOME with the directory where Maven in your system is located.

READ More Relevant Stuff:  Linux Kernel 5.0 Released | Download Now

Finally, now you need to make the file executable by running the command:

sudo chmod +x /etc/profile.d/maven.sh

Finally, apply the changes  running the following command:

source /etc/profile.d/maven.sh
Linux, Ubuntu 22.04 Tags:Apache

Post navigation

Previous Post: System76 Galago Pro Linux Laptop: Price & Specification
Next Post: How To Fix Broken Packages On Raspberry Pi OS

Related Posts

List Of Top 7 YUM Third Party Repositories For RHEL And CentOS List Of Top 7 YUM Third Party Repositories For RHEL And CentOS Linux
AlmaLinux OS 8.6 Is Now Available for Download AlmaLinux OS 8.6 Is Now Available for Download Linux
Install Zoom In Linux Based Operating System Install Zoom In Linux Based Operating System Linux
Google Discontinues Chrome And Chrome OS Releases Google Discontinues Chrome And Chrome OS Releases Google
How To Upgrade To Fedora 32 From Fedora 31 How To Upgrade To Fedora 32 From Fedora 31 Linux
Best Xfce Themes For Linux Best Xfce Themes For Linux Linux

Recent Posts

  • New Job Search October 10, 2025
  • How To Enable Hibernate in Ubuntu 22.04 LTS May 20, 2024
  • Popular Ubuntu Games: Top 5 Games To Play March 17, 2024
  • WordPress | Your site doesn’t include support for the “generateblocks/container” block GenerateBlocks Plugin February 11, 2024
  • Ubuntu Autoremove Command Debian Autoremove Command February 10, 2024
  • How To Mount Windows 11 Shares on Debian Linux December 7, 2023
  • Anonymous Browsing 101: A Deep Dive Into Residential Proxies November 20, 2023
  • How To Correctly Install Uninstall Linux Ubuntu Nvidia Drivers Fast October 31, 2023
  • Ethical Web Design: The Dos and Don’ts October 28, 2023
  • Understanding the Role of Security Operations Center October 25, 2023
  • The Positive Effects of AI Tools and Online Services on Students Successful Essay-Writing Skills October 3, 2023

Categories

  • Android
  • Apple
  • Blogs
  • Debian
  • Fix
  • Gadgets
  • Game
  • Google
  • How To Ubuntu
  • Internet
  • Laptops
  • Linux
  • Linux Commands
  • Linux Game
  • Linux Mint
  • News
  • Operating Systems
  • Security
  • Technology
  • Themes
  • Tools
  • Tutorials
  • Ubuntu
  • ubuntu 18.04
  • Ubuntu 20.04
  • Ubuntu 22.04
  • Windows 11
  • Wordpress
  • Search Jobs
  • Post a Job
  • Job Dashboard
  • Contact Us
  • About US
  • Cookie Policy
  • Terms and Conditions
  • Privacy Policy
  • Sitemap
  • Write For US

Tags

android apps centos ChatGPT command Commands Debian deepin Desktop docker Fedora fix game games Gaming gnome google kernel linux linux commands linux kernel Linux laptops Linux Mint Linux themes minecraft NVIDIA Python Raspberry Pi sysadmin themes ubuntu ubuntu 18.04 Ubuntu 18.04 LTS Ubuntu 20.04 ubuntu 20.04 lts Ubuntu 22.04 LTS Ubuntu games Ubuntu kernel ubuntu themes ubuntu tutorial VirtualBox Windows Windows 11 Wine WSL
itsubuntu.com is an Equal Opportunity Employer. For Advertisement, Jobs, Guest posts, and any other thoughts, email us at [email protected]
  • SQL Report Writer

    • Hammonton, NJ
    • TWO95 International
    • Full Time
  • Sr Electrical Engineer, Data Center (Hybrid)

    • San Jose, CA
    • CyberCoders
    • Full Time
  • Distinguished Data Engineer

    • Petersburg, VA (Remote)
    • Capital One
    • Full Time
  • Deviation Writer

    • Durham, NC
    • Process Alliance
    • Full Time
  • Remote Blockchain Engineering Manager (San Francisco)

    • San Francisco, CA
    • Circle
    • Full Time
  • Azure Engineer

    • Fort Worth, TX
    • Jobot
    • Full Time
  • Nights & Weekends Blogger, The Cut

    • Remote
    • Vox Media
    • Full Time
  • AI / Machine Learning Engineer

    • Stratford, CT
    • Lockheed Martin
    • Full Time

Copyright © 2025 Technology News Information & Jobs.

Powered by PressBook Grid Blogs theme