{"id":4386,"date":"2018-12-06T08:32:32","date_gmt":"2018-12-06T13:32:32","guid":{"rendered":"http:\/\/springframework.guru\/?p=4386"},"modified":"2019-06-15T13:06:55","modified_gmt":"2019-06-15T17:06:55","slug":"installing-maven","status":"publish","type":"post","link":"https:\/\/springframework.guru\/installing-maven\/","title":{"rendered":"Installing Maven"},"content":{"rendered":"<p>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.<\/p>\n<h2 data-pm-slice=\"1 1 []\">General Requirements<\/h2>\n<ul>\n<li>Java JDK\u00a0must be installed on system.<\/li>\n<li>Java 1.7 or higher is needed for Maven.<\/li>\n<\/ul>\n<p>To verify the Java JDK\u00a0is properly installed, from your command line run the following command:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\" data-enlighter-linenumbers=\"false\">jt$ javac --version<\/pre>\n<p>You should see:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\" data-enlighter-linenumbers=\"false\">javac 11<\/pre>\n<p>This command verifies the Java complier (javac)\u00a0is installed.<\/p>\n<p>If javac is not found, check your Java JDK\u00a0installation.<\/p>\n<p>Maven will not function without a properly installed.<\/p>\n<h2>Installing Apache Maven on Windows 10<\/h2>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\n<li>To install Apache Maven on Windows 10, ensure <code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\" data-enlighter-linenumbers=\"false\">JAVA_HOME<\/code> is set.<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\" data-enlighter-linenumbers=\"false\">echo %JAVA_HOME%<\/pre>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\n<li>Download the binary zip archive from a <a href=\"http:\/\/mirrors.wuchna.com\/apachemirror\/maven\/maven-3\/3.6.0\/binaries\/apache-maven-3.6.0-bin.zip\">downloaded mirror<\/a>.<\/li>\n<li>Extract the archive to a suitable location.<\/li>\n<li>Add the <code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\" data-enlighter-linenumbers=\"false\">bin<\/code> directory of the extracted Maven directory to the <code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\" data-enlighter-linenumbers=\"false\">PATH<\/code> environment variable. The steps to do so on Windows 10 is:\n<ol>\n<li>Right-click <strong>This PC<\/strong> and select <strong>Properties<\/strong>.<\/li>\n<li>On the left pane, select<strong> Advance system settings<\/strong>.<\/li>\n<li>Click the <strong>Environment Variables<\/strong> button.<\/li>\n<li>In the <strong>Environment Variables<\/strong> dialog box that appears, double-click <strong>Path<\/strong> under <strong>System variables<\/strong>.<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p><a href=\"http:\/\/springframework.guru\/wp-content\/uploads\/2018\/12\/setting_path_system_variables.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4390\" src=\"http:\/\/springframework.guru\/wp-content\/uploads\/2018\/12\/setting_path_system_variables.png\" alt=\"Setting PATH as System Variables\" width=\"602\" height=\"570\" srcset=\"https:\/\/springframework.guru\/wp-content\/uploads\/2018\/12\/setting_path_system_variables.png 602w, https:\/\/springframework.guru\/wp-content\/uploads\/2018\/12\/setting_path_system_variables-300x284.png 300w, https:\/\/springframework.guru\/wp-content\/uploads\/2018\/12\/setting_path_system_variables-410x388.png 410w\" sizes=\"(max-width: 602px) 100vw, 602px\" \/><\/a><\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\n<li>In the <strong>Edit environment variable<\/strong> dialog box that appears, click the <strong>New<\/strong> button.<\/li>\n<li>Add the path to the <code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\" data-enlighter-linenumbers=\"false\">bin<\/code> directory of the Maven installation. An example path is <code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\" data-enlighter-linenumbers=\"false\">C:\\apache-maven-3.6.0\\bin<\/code><\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p><a href=\"http:\/\/springframework.guru\/wp-content\/uploads\/2018\/12\/Edit_environment_variable.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4391\" src=\"http:\/\/springframework.guru\/wp-content\/uploads\/2018\/12\/Edit_environment_variable.png\" alt=\"Edit Environment Variables Dialog Box\" width=\"527\" height=\"501\" srcset=\"https:\/\/springframework.guru\/wp-content\/uploads\/2018\/12\/Edit_environment_variable.png 527w, https:\/\/springframework.guru\/wp-content\/uploads\/2018\/12\/Edit_environment_variable-300x285.png 300w, https:\/\/springframework.guru\/wp-content\/uploads\/2018\/12\/Edit_environment_variable-410x390.png 410w\" sizes=\"(max-width: 527px) 100vw, 527px\" \/><\/a><\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\n<li>Click the <strong>OK<\/strong> button.<\/li>\n<li>Click the <strong>OK<\/strong> button to close the <strong>Environment Variables<\/strong> dialog box.<\/li>\n<li>Finally, click the <strong>OK<\/strong> button to close <strong>System Properties<\/strong>.<\/li>\n<\/ol>\n<\/li>\n<li>Open a new command prompt window and type the following command.<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\" data-enlighter-linenumbers=\"false\">mvn -v<\/pre>\n<p>This command displays the version information. This also verifies that Maven is installed on your computer.<\/p>\n<h2>Installing Apache Maven on POSIX Compliant Operating System (Linux and Mac OS X)<\/h2>\n<p>To install Maven on a POSIX Compliant Operating System, such as Linux or Mac OS X<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\n<li>Ensure <code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\" data-enlighter-linenumbers=\"false\">JAVA_HOME<\/code> is set.<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\" data-enlighter-linenumbers=\"false\">echo $JAVA_HOME<\/pre>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\n<li>Download the binary archive from a <a href=\"http:\/\/mirrors.estointernet.in\/apache\/maven\/maven-3\/3.6.0\/binaries\/apache-maven-3.6.0-bin.tar.gz\">download mirror<\/a>.<\/li>\n<li>Switch the Maven contents.<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\" data-enlighter-linenumbers=\"false\">mv Downloads\/apache-maven* \/opt\/apache-maven<\/pre>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\n<li>Add Maven binaries to the <code class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\" data-enlighter-linenumbers=\"false\">PATH<\/code> and append.<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\" data-enlighter-linenumbers=\"false\">export PATH=\/opt\/apache-maven-3.6.0\/bin:$PATH<\/pre>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\n<li>Open a new terminal window and type this command.<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"git\" data-enlighter-linenumbers=\"false\">mvn -v<\/pre>\n<p>This command displays the version information and verifies that Maven is installed on your computer.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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\u00a0must be installed on system. Java 1.7 or higher is needed for Maven. To verify the [&hellip;]<a href=\"https:\/\/springframework.guru\/installing-maven\/\" class=\"df-link-excerpt\">Continue reading<\/a><\/p>\n","protected":false},"author":1,"featured_media":4584,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"","_lmt_disable":"","_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[20],"tags":[27,28],"class_list":["post-4386","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java","tag-java","tag-maven"],"jetpack_publicize_connections":[],"aioseo_notices":[],"modified_by":"Simanta","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/springframework.guru\/wp-content\/uploads\/2015\/03\/Banner560x292_01web.jpg","jetpack_shortlink":"https:\/\/wp.me\/p5BZrZ-18K","_links":{"self":[{"href":"https:\/\/springframework.guru\/wp-json\/wp\/v2\/posts\/4386"}],"collection":[{"href":"https:\/\/springframework.guru\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/springframework.guru\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/springframework.guru\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/springframework.guru\/wp-json\/wp\/v2\/comments?post=4386"}],"version-history":[{"count":10,"href":"https:\/\/springframework.guru\/wp-json\/wp\/v2\/posts\/4386\/revisions"}],"predecessor-version":[{"id":5569,"href":"https:\/\/springframework.guru\/wp-json\/wp\/v2\/posts\/4386\/revisions\/5569"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/springframework.guru\/wp-json\/wp\/v2\/media\/4584"}],"wp:attachment":[{"href":"https:\/\/springframework.guru\/wp-json\/wp\/v2\/media?parent=4386"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/springframework.guru\/wp-json\/wp\/v2\/categories?post=4386"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/springframework.guru\/wp-json\/wp\/v2\/tags?post=4386"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}