You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by "Alex Wood (JIRA)" <ji...@codehaus.org> on 2005/09/19 16:54:10 UTC

[jira] Created: (MNG-919) Installation with symlinks

Installation with symlinks
--------------------------

         Key: MNG-919
         URL: http://jira.codehaus.org/browse/MNG-919
     Project: Maven 2
        Type: Improvement
  Components: maven-core  
    Versions: 2.0-beta-1    
 Environment: Linux/Unix
 Reporter: Alex Wood
 Attachments: m2-failed-start.txt

When trying to install the Maven 2 beta, I followed the instructions available at http://maven.apache.org/maven2/download.html

However, I did not set my $PATH to include a reference to the Maven 2 directory.  I prefer to keep my $PATH very short and so I put a symlink to m2 in /usr/local/bin.  When I tried to start Maven 2, I received the following message:

Exception in thread "main" java.lang.NoClassDefFoundError: org/codehaus/classworlds/Launcher

After looking at the m2 shell script, I noticed the reference to $M2_HOME was not being set correctly.  After setting that variable correctly, Maven 2 started without a problem.

I've attached the output of bash -x for a failed startup.  It looks to me like the problem is in this section

 ## resolve links - $0 may be a link to maven's home
  PRG="$0"
  saveddir=`pwd`

  # need this for relative symlinks
  PRGDIR=`dirname "$PRG"`
  cd "$PRGDIR"

  while [ -h "$PRG" ] ; do
     [...]

Since my symlink was in my path, PRG got set to just "m2" which fouled the rest of the script.  Using 'which' might help here.
------------------------
Regards,
Alex

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[jira] Commented: (MNG-919) Installation with symlinks

Posted by "Jerome Lacoste (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-919?page=comments#action_47520 ] 

Jerome Lacoste commented on MNG-919:
------------------------------------

My environment:

jerome@expresso> echo $M2_HOME

jerome@expresso> which m2
/home/jerome/local/bin/m2
jerome@expresso> ls -la `which m2`
lrwxrwxrwx  1 jerome jerome 32 2005-09-23 00:44 /home/jerome/local/bin/m2 -> /home/jerome/local/lib/m2/bin/m2
jerome@expresso> ls -la `which m2.old`
lrwxrwxrwx  1 jerome jerome 32 2005-09-23 00:44 /home/jerome/local/bin/m2.old -> /home/jerome/local/lib/m2/bin/m2.old
jerome@expresso> ls -la /home/jerome/local/lib/m2       
lrwxrwxrwx  1 jerome jerome 16 2005-09-30 08:24 /home/jerome/local/lib/m2 -> maven-2.0-beta-2

jerome@expresso> pwd
/home/jerome/local/lib/

jerome@expresso> sh -x ./m2/bin/m2.old 
+ '[' -f /etc/mavenrc ']'
+ '[' -f /home/jerome/.mavenrc ']'
+ . /home/jerome/.mavenrc
+ cygwin=false
+ darwin=false
+ case "`uname`" in
++ uname
+ '[' -z '' ']'
+ '[' -d /opt/m2 ']'
+ '[' -d /home/jerome/m2 ']'
+ PRG=./m2/bin/m2.old
++ pwd
+ saveddir=/home/jerome/local/lib
++ dirname ./m2/bin/m2.old
+ PRGDIR=./m2/bin
+ cd ./m2/bin
+ '[' -h ./m2/bin/m2.old ']'
+ M2_HOME=./m2/bin/..
++ cd ./m2/bin/..
./m2/bin/m2.old: line 77: cd: ./m2/bin/..: Not a directory
+ M2_HOME=
+ cd /home/jerome/local/lib
+ false
+ '[' -z '' ']'
+ '[' -n /usr/local/lib/java ']'
+ '[' -x /usr/local/lib/java/jre/sh/java ']'
+ JAVACMD=/usr/local/lib/java/bin/java
+ '[' '!' -x /usr/local/lib/java/bin/java ']'
+ '[' -z /usr/local/lib/java ']'
+ CLASSWORLDS_LAUNCHER=org.codehaus.classworlds.Launcher
+ false
+ exec /usr/local/lib/java/bin/java -classpath '/core/boot/classworlds-*.jar' -Dclassworlds.conf=/bin/m2.conf -Dmaven.home= org.codehaus.classworlds.Launcher
Exception in thread "main" java.lang.NoClassDefFoundError: org/codehaus/classworlds/Launcher


With the fixed script

jerome@expresso> sh -x ./m2/bin/m2 -version
+ '[' -f /etc/mavenrc ']'
+ '[' -f /home/jerome/.mavenrc ']'
+ . /home/jerome/.mavenrc
+ cygwin=false
+ darwin=false
+ case "`uname`" in
++ uname
+ '[' -z '' ']'
+ '[' -d /opt/m2 ']'
+ '[' -d /home/jerome/m2 ']'
+ PRG=./m2/bin/m2
+ '[' -h ./m2/bin/m2 ']'
++ pwd
+ saveddir=/home/jerome/local/lib
++ dirname ./m2/bin/m2
+ M2_HOME=./m2/bin/..
++ cd ./m2/bin/..
++ pwd
+ M2_HOME=/home/jerome/local/lib/m2
+ cd /home/jerome/local/lib
+ false
+ '[' -z '' ']'
+ '[' -n /usr/local/lib/java ']'
+ '[' -x /usr/local/lib/java/jre/sh/java ']'
+ JAVACMD=/usr/local/lib/java/bin/java
+ '[' '!' -x /usr/local/lib/java/bin/java ']'
+ '[' -z /usr/local/lib/java ']'
+ CLASSWORLDS_LAUNCHER=org.codehaus.classworlds.Launcher
+ false
+ exec /usr/local/lib/java/bin/java -classpath /home/jerome/local/lib/m2/core/boot/classworlds-1.1-alpha-2.jar -Dclassworlds.conf=/home/jerome/local/lib/m2/bin/m2.conf -Dmaven.home=/home/jerome/local/lib/m2 org.codehaus.classworlds.Launcher -version
Maven version: 2.0-beta-2

Works also from:

jerome@expresso> pwd   
/home/jerome
jerome@expresso> m2.old -v
Exception in thread "main" java.lang.NoClassDefFoundError: org/codehaus/classworlds/Launcher
jerome@expresso> m2 -v
Maven version: 2.0-beta-2

and 

jerome@expresso> pwd
/home/jerome/local/lib/m2
jerome@expresso> m2.old -v
Exception in thread "main" java.lang.NoClassDefFoundError: org/codehaus/classworlds/Launcher
jerome@expresso> m2 -v
Maven version: 2.0-beta-2

Patch coming

> Installation with symlinks
> --------------------------
>
>          Key: MNG-919
>          URL: http://jira.codehaus.org/browse/MNG-919
>      Project: Maven 2
>         Type: Improvement
>   Components: maven-core
>     Versions: 2.0-beta-1
>  Environment: Linux/Unix
>     Reporter: Alex Wood
>  Attachments: m2-failed-start.txt
>
>
> When trying to install the Maven 2 beta, I followed the instructions available at http://maven.apache.org/maven2/download.html
> However, I did not set my $PATH to include a reference to the Maven 2 directory.  I prefer to keep my $PATH very short and so I put a symlink to m2 in /usr/local/bin.  When I tried to start Maven 2, I received the following message:
> Exception in thread "main" java.lang.NoClassDefFoundError: org/codehaus/classworlds/Launcher
> After looking at the m2 shell script, I noticed the reference to $M2_HOME was not being set correctly.  After setting that variable correctly, Maven 2 started without a problem.
> I've attached the output of bash -x for a failed startup.  It looks to me like the problem is in this section
>  ## resolve links - $0 may be a link to maven's home
>   PRG="$0"
>   saveddir=`pwd`
>   # need this for relative symlinks
>   PRGDIR=`dirname "$PRG"`
>   cd "$PRGDIR"
>   while [ -h "$PRG" ] ; do
>      [...]
> Since my symlink was in my path, PRG got set to just "m2" which fouled the rest of the script.  Using 'which' might help here.
> ------------------------
> Regards,
> Alex

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[jira] Closed: (MNG-919) Installation with symlinks

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-919?page=all ]
     
Brett Porter closed MNG-919:
----------------------------

    Resolution: Duplicate

> Installation with symlinks
> --------------------------
>
>          Key: MNG-919
>          URL: http://jira.codehaus.org/browse/MNG-919
>      Project: Maven 2
>         Type: Improvement
>   Components: maven-core
>     Versions: 2.0-beta-1
>  Environment: Linux/Unix
>     Reporter: Alex Wood
>  Attachments: m2-failed-start.txt
>
>
> When trying to install the Maven 2 beta, I followed the instructions available at http://maven.apache.org/maven2/download.html
> However, I did not set my $PATH to include a reference to the Maven 2 directory.  I prefer to keep my $PATH very short and so I put a symlink to m2 in /usr/local/bin.  When I tried to start Maven 2, I received the following message:
> Exception in thread "main" java.lang.NoClassDefFoundError: org/codehaus/classworlds/Launcher
> After looking at the m2 shell script, I noticed the reference to $M2_HOME was not being set correctly.  After setting that variable correctly, Maven 2 started without a problem.
> I've attached the output of bash -x for a failed startup.  It looks to me like the problem is in this section
>  ## resolve links - $0 may be a link to maven's home
>   PRG="$0"
>   saveddir=`pwd`
>   # need this for relative symlinks
>   PRGDIR=`dirname "$PRG"`
>   cd "$PRGDIR"
>   while [ -h "$PRG" ] ; do
>      [...]
> Since my symlink was in my path, PRG got set to just "m2" which fouled the rest of the script.  Using 'which' might help here.
> ------------------------
> Regards,
> Alex

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org