/bin/sh: mvn: command not found

3,859 views
Skip to first unread message

hong chang

unread,
Jun 19, 2014, 4:06:49 AM6/19/14
to eclim...@googlegroups.com
Hi all,

I got this error message when I am using :Mvn command. But I can run mvn on my terminal correctly. Also I got error in my code where I use maven packages. It seems there is problem about my Maven. But I can run maven property on my eclipse and terminal. Could anyone help me? Thanks.

Eric Van Dewoestine

unread,
Jun 19, 2014, 10:09:26 AM6/19/14
to eclim...@googlegroups.com
On 2014-06-19 01:06:49, hong chang wrote:
> Hi all,
>
> I got this error message when I am using :Mvn command. But I can run mvn on
> my terminal correctly.

Sounds like mvn isn't on the path of the shell that vim creates to
run external commands. Perhaps you are adding mvn to your path in your
.bashrc or similar which isn't sourced by the shell vim is using.

> Also I got error in my code where I use maven packages.

Can you be more specific and provide an example?

By 'error in my code', are you referring to eclim's code validation on
save?

By 'maven packages' do you mean org.apache.maven packages, or are you
referring to packages from dependencies defined in your pom.xml?

--
eric
Message has been deleted

hong chang

unread,
Jun 19, 2014, 2:26:43 PM6/19/14
to eclim...@googlegroups.com
Hi Eric,

Thanks for replying me.

 For the first one, I think you're right. The problem should be the path of Maven. But it still doesn't work, when I add it into .bashrc file. Could you tell me which file should I use to add path? Thanks.


For the second one, I attached the snapshot. You can see that there are errors where I import the libraries using maven, but no error where I use standard libraries. However, this project works well on my eclipse and Intellij. Could you help me out of here? Thanks.



Jason
Screen Shot 2014-06-19 at 11.24.54 AM.png

Eric Van Dewoestine

unread,
Jun 19, 2014, 3:40:55 PM6/19/14
to eclim...@googlegroups.com
On 2014-06-19 11:26:42, hong chang wrote:
> Hi Eric,
>
> Thanks for replying me.
>
> For the first one, I think you're right. The problem should be the path of
> Maven. But it still doesn't work, when I add it into .bashrc file. Could
> you tell me which file should I use to add path? Thanks.

The best solution would be to have a symlink to mvn inside /usr/bin or
similar. Your .bashrc won't be sourced by the shell that vim starts to
run external commands.

> For the second one, I attached the snapshot. You can see that there are
> errors where I import the libraries using maven, but no error where I use
> standard libraries.

Check your project's .classpath file to ensure you've defined entries
for all your libraries. If you open the .classpath file in vim and
save it, eclim should either report some errors if any libs that it
cannot find, or display a message that the project was updated.

> However, this project works well on my eclipse...

That's odd since eclim is just essentially a proxy/façade to eclipse.
If you are getting validation errors in eclim, then you should be
getting the same validation errors in the eclipse gui. If you aren't,
then make sure you don't have some other java validation plugin for
vim installed.

>
> Jason
>
>
> On Thursday, June 19, 2014 7:09:26 AM UTC-7, Eric Van Dewoestine wrote:
> >
> > On 2014-06-19 01:06:49, hong chang wrote:
> > > Hi all,
> > >
> > > I got this error message when I am using :Mvn command. But I can run mvn
> > on
> > > my terminal correctly.
> >
> > Sounds like mvn isn't on the path of the shell that vim creates to
> > run external commands. Perhaps you are adding mvn to your path in your
> > .bashrc or similar which isn't sourced by the shell vim is using.
> >
> > > Also I got error in my code where I use maven packages.
> >
> > Can you be more specific and provide an example?
> >
> > By 'error in my code', are you referring to eclim's code validation on
> > save?
> >
> > By 'maven packages' do you mean org.apache.maven packages, or are you
> > referring to packages from dependencies defined in your pom.xml?
> >
> > --
> > eric
> >
>
> --
> You received this message because you are subscribed to the Google Groups "eclim-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to eclim-user+...@googlegroups.com.
> To post to this group, send email to eclim...@googlegroups.com.
> Visit this group at http://groups.google.com/group/eclim-user.
> For more options, visit https://groups.google.com/d/optout.



--
eric

hong chang

unread,
Jun 19, 2014, 5:03:28 PM6/19/14
to eclim...@googlegroups.com
Yeah you're right. It works after I changed .classpath file. Thank you very much Eric!
Reply all
Reply to author
Forward
0 new messages