(Moved here from infra@)...

So, as soon as I ran it I saw (among the other debug info)...

...
...
+ echo 'Error: JAVA_HOME is not defined correctly.'
Error: JAVA_HOME is not defined correctly.   <------- Aha!
+ echo '  We cannot execute java'
  We cannot execute java
+ exit 1



Here's a few details that might help:
------------------------------------

[EMAIL PROTECTED] ~]$ cat .profile
#       This is the default standard profile provided to a user.
#       They are expected to edit it to meet their own needs.

MAIL=/usr/mail/${LOGNAME:?}
TERM=vt100
#PS1="[EMAIL PROTECTED](hostname)] # "
PS1='[EMAIL PROTECTED] \w]\$ '

alias ll='ls -l'

#PATH=/usr/bin
PATH=$PATH:/opt/subversion-1.1.4/bin

#JAVA_HOME=/usr/jdk/instances/jdk1.5.0
JAVA_HOME=/usr/j2sdk1.4.2_09
#JAVA_HOME=/usr/java

ANT_HOME=/export/home/jmitchell/apache_home/apache-ant-1.6.5
MAVEN_HOME=/export/home/jmitchell/apache_home/maven-2.0.4

PATH=/usr/bin:
PATH=$PATH:/usr/sfw/bin:
PATH=$PATH:/usr/sfw/sbin:
PATH=$PATH:/opt/sfw/bin:
PATH=$PATH:/opt/sfw/sbin:
PATH=$PATH:/opt/SUNWspro/bin:
PATH=$PATH:/usr/X/bin:
PATH=$PATH:/usr/ucb:
PATH=$PATH:/usr/sbin:
PATH=$PATH:/usr/ccs/bin:
PATH=$PATH:/etc
PATH=$PATH:.
PATH=$PATH:/opt/subversion-1.1.4/bin

PATH=$PATH:$ANT_HOME/bin/
PATH=$PATH:$JAVA_HOME/bin/
PATH=$PATH:$MAVEN_HOME/bin/




[EMAIL PROTECTED] ~]$ bash -x /export/home/jmitchell/apache_home/ maven-2.0.4/bin/mvn -v
+ QUOTED_ARGS=
+ '[' -v '!=' '' ']'
+ QUOTED_ARGS=' "-v"'
+ shift
+ '[' '' '!=' '' ']'
+ '[' -f /etc/mavenrc ']'
+ '[' -f /export/home/jmitchell/.mavenrc ']'
+ cygwin=false
+ darwin=false
+ case "`uname`" in
++ uname
+ '[' -z '' ']'
+ '[' -e /etc/gentoo-release ']'
+ '[' -z '' ']'
+ '[' -d /opt/m2 ']'
+ '[' -d /export/home/jmitchell/m2 ']'
+ PRG=/export/home/jmitchell/apache_home/maven-2.0.4/bin/mvn
+ '[' -h /export/home/jmitchell/apache_home/maven-2.0.4/bin/mvn ']'
++ pwd
+ saveddir=/export/home/jmitchell
++ dirname /export/home/jmitchell/apache_home/maven-2.0.4/bin/mvn
+ M2_HOME=/export/home/jmitchell/apache_home/maven-2.0.4/bin/..
++ cd /export/home/jmitchell/apache_home/maven-2.0.4/bin/..
++ pwd
+ M2_HOME=/export/home/jmitchell/apache_home/maven-2.0.4
+ cd /export/home/jmitchell
+ false
+ '[' -z '' ']'
+ '[' -n '' ']'
+ JAVACMD=java
+ '[' '!' -x java ']'
+ echo 'Error: JAVA_HOME is not defined correctly.'
Error: JAVA_HOME is not defined correctly.
+ echo '  We cannot execute java'
  We cannot execute java
+ exit 1




[EMAIL PROTECTED] ~]$ set
ANT_HOME=/export/home/jmitchell/apache_home/apache-ant-1.6.5
...
(snip)
...
IFS=$' \t\n'
JAVA_HOME=/usr/j2sdk1.4.2_09
LINES=65
LOGNAME=jmitchell
MACHTYPE=i386-pc-solaris2.10
MAIL=/usr/mail/jmitchell
MAILCHECK=60
MAVEN_HOME=/export/home/jmitchell/apache_home/maven-2.0.4
...
(snip)
...
PATH=/usr/bin::/usr/sfw/bin::/usr/sfw/sbin::/opt/sfw/bin::/opt/sfw/ sbin::/opt/SUNWspro/bin::/usr/X/bin::/usr/ucb::/usr/sbin::/usr/ccs/ bin::/etc:.:/opt/subversion-1.1.4/bin:/export/home/jmitchell/ apache_home/apache-ant-1.6.5/bin/:/usr/j2sdk1.4.2_09/bin/:/export/ home/jmitchell/apache_home/maven-2.0.4/bin/
PIPESTATUS=([0]="1")
...
(snip)
...
SHELL=/bin/bash
SHELLOPTS=braceexpand:emacs:hashall:histexpand:history:interactive- comments:monitor
SHLVL=1
...
(snip)
...
SSH_TTY=/dev/pts/1
TERM=vt100
TZ=GMT0
UID=110
USER=jmitchell
_=-v

I've tried JAVA_HOME as:
JAVA_HOME=/usr/jdk/instances/jdk1.5.0 <- no luck
JAVA_HOME=/usr/j2sdk1.4.2_09          <- no luck
JAVA_HOME=/usr/java <- simply a symlink to the first one, no luck



Thanks for the help.



--
James Mitchell




On Jul 25, 2006, at 8:56 PM, Brett Porter wrote:
Hi James,

Maybe best to take this over to dev@maven.apache.org and we'll see if we can identify the problem and either document the solution or improve the handling.

Can you run:
bash -x /export/home/jmitchell/apache_home/maven-2.0.4/bin/mvn -v

and send the output over to that list? I'm not sure which test command is failing in the shell script for you.

BTW, the home is set by M2_HOME (but having that empty won't cause the script to fail, it uses the path of mvn to set it)

- Brett

On 26/07/2006 10:44 AM, James Mitchell wrote:
Somehow I have screwed up my user account such that I cannot run Maven 2. I keep getting this stupid error message...
[EMAIL PROTECTED] ~]$ mvn
/export/home/jmitchell/apache_home/maven-2.0.4/bin/mvn: test: argument expected (however, the same setup for Ant works fine -- meaning I set MAVEN_HOME and add $MAVEN_HOME/bin to the PATH in my .profile)
[EMAIL PROTECTED] ~]$ ant
Buildfile: build.xml does not exist!
Build failed
Google only finds my own rants about this issue:
http://www.google.com/search?hl=en&q=maven+mvn%3A+test%3A+argument +expected I have tried removing my copy of the binaries, and using the one under /usr/local/, same error.
I downloaded the binaries from a different mirror, same error.
Can anyone throw me a bone?
--
James Mitchell







---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to