Alex Karasulu wrote:
J�rg,

I would think the same but I encountered some wierd behavoir.
Part of it has to do with Cygwin shell variable expansion and part of it with the fact that when on Cygwin/Windows java expects the -jar value to be in the Windows path style. This
fixed the problem for me because I forced the -jar value to be
in the Windows path format.

That is because it is using the WIndows java.exe command to execute things.

There is a routine called cygpath or something to do the path
translation.

To determine if we are working in a Cygwin environment you can do the
following (pulled from the Maven script):

# OS specific support.  $var _must_ be set to either true or false.
cygwin=false;
darwin=false;
case "`uname`" in
  CYGWIN*) cygwin=true ;;
  Darwin*) darwin=true ;;
esac

To convert things to Unix paths use something like the following (again
pulled from the maven script):

# For Cygwin, ensure paths are in UNIX format before anything is touched
if $cygwin ; then
  [ -n "$MAVEN_HOME" ] &&
    MAVEN_HOME=`cygpath --unix "$MAVEN_HOME"`
  [ -n "$MAVEN_HOME_LOCAL" ] &&
    MAVEN_HOME_LOCAL=`cygpath --unix "$MAVEN_HOME_LOCAL"`
  [ -n "$JAVA_HOME" ] &&
    JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
  [ -n "$CLASSPATH" ] &&
    CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
fi

Lastly to convert to windows paths for Java (including the classpath):

# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
  [ -n "$MAVEN_HOME" ] &&
    MAVEN_HOME=`cygpath --path --windows "$MAVEN_HOME"`
  [ -n "$MAVEN_HOME_LOCAL" ] &&
    MAVEN_HOME_LOCAL=`cygpath --path --windows "$MAVEN_HOME_LOCAL"`
  [ -n "$JAVA_HOME" ] &&
    JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
  [ -n "$MAVEN_ENDORSED" ] &&
    MAVEN_ENDORSED=`cygpath --path --windows "$MAVEN_ENDORSED"`
fi



When I ran the merlin.sh the java.exe program could not find the jar file with the main class to run. There is some other logic problem in the script I think that does not correctly set the variables in this file when dealing with Cygwin. That's why this change which should not have an effect is causing it to work properly on Cygwin.

If I had the time I would rewrite the script altogether.  If
you would like to submit a new script or delta's I'll commit
the changes.

Alex


--

"They that give up essential liberty to obtain a little temporary safety
 deserve neither liberty nor safety."
                - Benjamin Franklin


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



Reply via email to