Where is Maven Installed on Ubuntu

后端 未结 6 874
借酒劲吻你
借酒劲吻你 2020-12-12 14:47

I installed maven on my Ubuntu machine with the command sudo apt-get install maven

Now I need to know where it is installed in order to configure the sa

6条回答
  •  情深已故
    2020-12-12 15:30

    Here is a bash script for newer Maven copy and paste it...

    # @author Yucca Nel
    
    #!/bin/sh
    
    #This installs maven2 & a default JDK 
    sudo apt-get install maven2;
    
    #Makes the /usr/lib/mvn in case...
    sudo mkdir -p /usr/lib/mvn;
    
    #Clean out /tmp...
    sudo rm -rf /tmp/*;
    cd /tmp;
    
    #Update this line to reflect newer versions of maven
    wget http://mirrors.powertech.no/www.apache.org/dist//maven/binaries/apache-maven-3.0.3-bin.tar.gz;
    tar -xvf ./*gz;
    
    #Move it to where it to logical location
    sudo mv /tmp/apache-maven-3.* /usr/lib/mvn/;
    
    #Link the new Maven to the bin... (update for higher/newer version)...
    sudo ln -s /usr/lib/mvn/apache-maven-3.0.3/bin/mvn /usr/bin/mvn;
    
    #test
    mvn -version;
    
    exit 0;
    

提交回复
热议问题