Maven Installation

系统 1687 0

OS:Ubuntu 14.04

  1. Extract the distribution archive, i.e. apache-maven-3.2.2-bin.tar.gz to the directory you wish to install Maven 3.2.2. These instructions assume you chose /usr/local/apache-maven . The subdirectory apache-maven-3.2.2 will be created from the archive.
  2. In a command terminal, add the M2_HOME environment variable, e.g. export M2_HOME=/usr/local/apache-maven/apache-maven-3.2.2 .
  3. Add the M2 environment variable, e.g. export M2=$M2_HOME/bin .
  4. Optional : Add the MAVEN_OPTS environment variable to specify JVM properties, e.g. export MAVEN_OPTS="-Xms256m -Xmx512m" . This environment variable can be used to supply extra options to Maven.
  5. Add M2 environment variable to your path, e.g. export PATH=$M2:$PATH .
  6. Make sure that JAVA_HOME is set to the location of your JDK, e.g. export JAVA_HOME=/usr/java/jdk1.7.0_51 and that $JAVA_HOME/bin is in your PATH environment variable.
  7. Run mvn --version to verify that it is correctly installed.

About the environment:I put it in the file .bashrc

        1. sudo gedit/vim ~/.bashrc

        2. export M2_HOME=/usr/local/software/apache-maven-3.2.2/
            export M2=$M2_HOME/bin
            export MAVEN_OPTS="-Xms256m -Xmx512m"
            export PATH=$M2:$PATH

        3. restart the terminal

        4. mvn --version       

      Apache Maven 
      
        3.2.
        
          2 (45f7c06d68e745d05611f7fd14efb6594181933e; 
          
            2014-
            
              06-17T21:
              
                51:
                
                  42+
                  
                    08:
                    
                      00
                      
                        ) Maven home: /usr/local/software/apache-maven-
                        
                          3.2.
                          
                            2
                            
                               Java version: 
                              
                                1.7
                                
                                  .0_55, vendor: Oracle Corporation Java home: /usr/local/software/jdk1.
                                  
                                    7.0_55/
                                    
                                      jre Default locale: en_US, platform encoding: UTF-
                                      
                                        8
                                        
                                           OS name: 
                                          
                                            "
                                            
                                              linux
                                              
                                                ", version: 
                                                
                                                  "
                                                  
                                                    3.13.0-30-generic
                                                    
                                                      ", arch: 
                                                      
                                                        "
                                                        
                                                          amd64
                                                          
                                                            ", family: 
                                                            
                                                              "
                                                              
                                                                unix
                                                                
                                                                  "
                                                                  
                                                                     alexstuart@alexstuart:~$ sudo gedit ~/.bashrc
                                                                  
                                                                
                                                              
                                                            
                                                          
                                                        
                                                      
                                                    
                                                  
                                                
                                              
                                            
                                          
                                        
                                      
                                    
                                  
                                
                              
                            
                          
                        
                      
                    
                  
                
              
            
          
        
      
    

 

      

Maven Installation


更多文章、技术交流、商务合作、联系博主

微信扫码或搜索:z360901061

微信扫一扫加我为好友

QQ号联系: 360901061

您的支持是博主写作最大的动力,如果您喜欢我的文章,感觉我的文章对您有帮助,请用微信扫描下面二维码支持博主2元、5元、10元、20元等您想捐的金额吧,狠狠点击下面给点支持吧,站长非常感激您!手机微信长按不能支付解决办法:请将微信支付二维码保存到相册,切换到微信,然后点击微信右上角扫一扫功能,选择支付二维码完成支付。

【本文对您有帮助就好】

您的支持是博主写作最大的动力,如果您喜欢我的文章,感觉我的文章对您有帮助,请用微信扫描上面二维码支持博主2元、5元、10元、自定义金额等您想捐的金额吧,站长会非常 感谢您的哦!!!

发表我的评论
最新评论 总共0条评论