Couldn't execute with maven version - maven

I'm new to storm and maven i installed
Apache Maven 3.1.0
and need to use it to maven a project
when i used mvn compile exec:java -Dexec.classPathScope=compile -Dexec.mainClass=MYClass.cr
I got
The program 'mvn' can be found in the following packages:
* maven
* maven2
Try: sudo apt-get install <selected package>
except
mvn -version
Apache Maven 3.1.0

Your problem is that you are running /usr/bin/mvn (verify this by typing which mvn). This is where apt-get will install maven. However, you have installed maven somewhere under /opt, so simply running mvn isn't finding the maven you installed.
First ensure that your .bashrc is updated to include the correct path, and that the new path is before /usr/bin
PATH=/opt/apache-maven-3.1.0/bin:$PATH
Then you need to ensure that .bashrc is loaded. You can log out and in again, start a new console, or simply source it (. ~/.bashrc).

Related

install maven 3.6.0 on Mac

I am trying to install a specific version of man.brew install maven#3.6.0 is not working due to lack of 3.6 version (there is 3.5, 3.2, 3.3). installation with this guide https://maven.apache.org/install.html also not.
zsh: man not found
Any ideas?
You can use Maven Version Manager to manage multiple versions of maven. You can have a folder-specific maven version.
Steps
If you already installed the maven brew formula uninstall it brew remove --force maven
Install mvnvm. brew install mvnvm
To set the global maven version add an environment variable named DEFAULT_MVN_VERSION with the maven version you want as default as the value.
To set a Maven version for a specific folder create a file named mvnvm.properties in that folder and have the following content.
mvn_version=<maven version for the folder>
You can get the 3.6.3 binaries from here
https://dlcdn.apache.org/maven/maven-3/3.6.3/
Just saw and struggled for a bit before getting to the wget command

Why does homebrew link to ../Cellar and not /usr/local/Cellar?

I have:
MacOS 10.12.2
homebrew 1.1.5
maven 2.0.8
I am trying to install maven 3
before running brew, which mvn reports /usr/local/apache-maven-2.0.8/bin/mvn as we would expect.
after running brew install maven without errors which mvn now reports ../Cellar/maven/3.3.9/bin/mvn and mvn -v still reports 2.0.8.
I'm new to brew. brew doctor does not report any errors. What am I doing wrong?
Because users might install Homebrew in a different path (e.g. ~/.homebrew). In order to support any install path Homebrew uses relative paths when symlinking binaries and other files.
after running brew install maven without errors which mvn now reports ../Cellar/maven/3.3.9/bin/mvn and mvn -v still reports 2.0.8.
This is a different issue; this time due to your shell which checks the full path of an executable only the first time you use it. That is, the first time you typed mvn -v it did the equivalent of which mvn and remembered that path. The second time you typed mvn -v it used that path instead of re-checking it. Type hash -r to reset its memory or start a new shell.

Couldn't get maven version

I'm using Ubuntu and new to maven i started to install maven 3 with
wget http://archive.apache.org/dist/maven/maven-3/
3.1.0/binaries/apache-maven-3.1.0-bin.tar.gz
i need to install this version to be convenient with JDK6 after that i extracted this in /opt
then edited in .bashrc
export MVN_HOME="/tmp/apache-maven-3.1.0"
export PATH="$PATH:$MVN_HOME/bin"
i tested mvn -version but got
The program 'mvn' can be found in the following packages:
* maven
* maven2
Try: sudo apt-get install <selected package>
Have you checked which directories are already in $PATH and contain a mvn ?
Change your export statement to
export PATH="$MVN_HOME/bin:$PATH"
in order to make sure that your mvn comes first. Besides that you might want to scan for variants of mvn that are already on your system:
find / -name mvn

Can't find maven in OS X Yosemite 10.10.4

Nothing when I type:
$ whereis mvn
but I guess it is somewhere because from Eclipse I can select a pom.xml file and run it as maven build
As pointed out in the comments, Eclipse brings its own bundled Maven. If you want to use Maven on the shell, I suggest you install Homebrew and then install Maven like this:
brew install maven
After that you should be able to use mvn on the command line.
By the way, to find out where mvn is, use:
which mvn

Install Maven on Ubuntu

I am not able to install maven in Ubuntu 12.04
I tried : sudo apt-get install maven
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package maven is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'maven' has no installation candidate
when i run : apt-cache search maven
libapache-pom-java - Maven metadata for all Apache Software projects
libcommons-parent-java - Maven metadata for Apache Commons project
maven-ant-helper - helper scripts for building Maven components with ant
maven-repo-helper - Helper tools for including Maven metadata in Debian packages
libjenkins-plugin-parent-java - Jenkins Plugin Parent Maven POM
I am getting a message like this. How to resolve this ?
First search for Maven package....
For that run this command in terminal..
apt-cache search maven
Then install...
sudo apt-get install maven
And at last for verification...
mvn -version
Hope this will help you.... ;)
Download maven from apache maven official site and extract.
Move the application directory to /usr/local
sudo cp -R apache-maven-X.X.X /usr/local
Make a soft link in /usr/bin for universal access of mvn
sudo ln -s /usr/local/apache-maven-X.X.X/bin/mvn /usr/bin/mvn
Verify mvn installation
mvn --version

Resources