This is a small guide to install maven on ubuntu 20.04 LTS. Jul 28, 2021
Download maven from https://maven.apache.org/download.cgi click the link apache-maven-3.8.1-bin.tar.gz.
Extract the files in your downloads folder.
cd Downloadssudo tar xzvf apache-maven-3.8.1-bin.tar.gz -C/opt/In a terminal window enter the following.
nano .profile
Edit the file and add the following text at the bottom of the page.
JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
export JAVA_HOME
MAVEN_HOME=/opt/apache-maven-3.8.1
export MAVEN_HOME
PATH=$JAVA_HOME/bin:$MAVEN_HOME/bin:$PATH
export PATH
Now press ctrl + O to save the file, and ctrl + X to close the file.
Back in the terminal run the script with.
. .profile
Check the version of java and maven with the commands.
`java --version`
`mvn --version`
Now you should see the proper version of Maven installed.
If you open a new terminal window and the installation seems ineffective: LOGOUT AND LOGIN!!!**
Answer from MalcolmXYZ on Stack OverflowThis is a small guide to install maven on ubuntu 20.04 LTS. Jul 28, 2021
Download maven from https://maven.apache.org/download.cgi click the link apache-maven-3.8.1-bin.tar.gz.
Extract the files in your downloads folder.
cd Downloadssudo tar xzvf apache-maven-3.8.1-bin.tar.gz -C/opt/In a terminal window enter the following.
nano .profile
Edit the file and add the following text at the bottom of the page.
JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
export JAVA_HOME
MAVEN_HOME=/opt/apache-maven-3.8.1
export MAVEN_HOME
PATH=$JAVA_HOME/bin:$MAVEN_HOME/bin:$PATH
export PATH
Now press ctrl + O to save the file, and ctrl + X to close the file.
Back in the terminal run the script with.
. .profile
Check the version of java and maven with the commands.
`java --version`
`mvn --version`
Now you should see the proper version of Maven installed.
If you open a new terminal window and the installation seems ineffective: LOGOUT AND LOGIN!!!**
Following command helped me.
Remove current version:
sudo apt-get purge maven
Download the latest version:
wget https://dlcdn.apache.org/maven/maven-3/3.8.6/binaries/apache-maven-3.8.6-bin.tar.gz
tar -xvf apache-maven-3.8.6-bin.tar.gz
Installation:
sudo cp -r apache-maven-3.8.6 /opt
export PATH=/opt/apache-maven-3.8.6/bin:$PATH
echo -e "\nPATH=\"/opt/apache-maven-3.8.6/bin:\$PATH\"" >> ~/.profile
Script
#!/bin/sh
version=
version ] ; then echo "specify version" ; exit 1 ; fi
#Remove old maven
sudo apt-get purge maven -y
url="https://dlcdn.apache.org/maven/maven-3/${version}/binaries/apache-maven-${version}-bin.tar.gz"
echo $url
wget $url
sleep .4
tarFile="apache-maven-${version}-bin.tar.gz"
echo $tarFile
sudo tar -xvf $tarFile -C /opt/
export PATH=/opt/apache-maven-${version}/bin:$PATH
echo -e "\nPATH=\"/opt/apache-maven-${version}/bin:\$PATH\"" >> ~/.profile
Pass the 1st argument as the maven version.
Example: ./install.sh 3.8.7
Note: Make sure Java is installed before following the above steps.
How To Install Maven
Just curious, why maven doesn't have an installer? like JDK? and why installers don't set the path automatically to system variables themselves?
โHelp installing Maven clean install
I can't even figure out how to install maven!
How do people learn how to do this stuff?
takes time. Your work place wants to see how you solve previously unencountered problems. You will be much faster on your second time. And on your 10th you know it blindly :)
what exactly do you want to do with the JSON? I assume it already exists and you just consume it? But then what? What language do you continue working in with or is it just showing the data in some way?
It looks like you want to do it web based https://api.jquery.com/jquery.get/ is actually all you need if you use jquery
-
blank html doc
-
add jquery
-
paste that get code and change url to what you have
-
console.log resulting data
but then what? What do you want to achieve? You should be able to see the JSON in raw format in your browser anyways if you just enter the URL manually
More on reddit.comVideos
Hi,
In case anyone's interested, I put together a brief guide on how to install Apache Maven (on Linux, MacOS and Windows).
I hope you find it useful! :)
Add the manually installed maven binary-directory to your PATH-environment
export PATH=${PATH}:/usr/local/apache-maven/apache-maven-2.2.1/bin/
Had a similar issue on 11.10, this is how I solved it:
- Install Maven2 from Synaptic rather than downloading it from the website.
gedit ~/.bashrcand check if you haveM2_HOMEandM2env variables defined if so DELETE them, delete them fromPATHtoo, if there is a reference to them.- Reload bash and
trymvn --versionagain.