maven 3.3.9 on ubuntu 14.04



  • I had a maven and a maven2. sudo apt-get remove maven*
    - downloaded the latest version of the site. apache-maven-3.3.9-bin.zip
    - unpacked the archives. /opt/maven
    - changed name. apache-maven-3.3.9apache_maven_3.3.9 Now in the directory, two catalogues. apache_maven_3.3.9 apache-maven-3.3.9-bin.tar.gz
    - set up a variable environment. M2_HOMEexport M2_HOME=/opt/mavenIn the file /etc/profile
    - Established the PATH variable environment export PATH=$PATH:$M2_HOME/bin file /etc/profile
    After checking the correctness of the installation, dialing the command line mvn -version

    Annex 'mvn' can be found in the following packages:
    * maven
    * maven2
    Try: sudo apt-get install Évabrated package

    I chose. maven2
    After the installation, I'll check

    Apache Maven 2.2.1 (rdebian-14)
    Java version: 1.8.0-ea
    Java home: /usr/lib/jvm/java-8-oracle/jre
    Default locale: ru_UA, platform encoding: UTF-8
    OS name: "linux" version: "3.16.0-51-generic" arch: "amd64" Family: "unix."

    What did I do wrong? 2.2.1 Not the one I wrote. 3.3.9 ?



  • What theory is in the repository, it's in place. The handwriting doesn't make any difference.

    How can you understand, maven installed in the folder /opt/maven/apache-maven-3.3.9$PATH Signed catalogue /opt/maven/bin♪ Of course the system can't find him. To fix the situation, or unpack the contents of the archive so catalogue bin was in the file. /opt/mavenOr write.

    export M2_HOME=/opt/maven/apache-maven-3.3.9
    

    To make it easy to change the versions, I would recommend that we establish maven Catalogue /opt/apache-maven-3.3.9 and create a symbolic reference /opt/maven On this catalogue:

    ln -s /opt/apache-maven-3.3.9 /opt/maven
    

    This will prevent the need to sign new values $PATH and $M2_HOME♪ For the change of the story, it would be easy to remove the reference and create a new catalogue.

    Let's do it now. maven "seeable" in the system. If this is not done, she will claim that the required programme has not been found and proposed to set it out of the repository. In the catalogue. /etc/profile.d Let's make a file with a name, for example. maven.sh with the following contents:

    export M2_HOME=/opt/maven
    export PATH=$PATH:$M2_HOME/bin
    

    Reload the system or re-routine it. Ready! Maven It works.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2