Bug 10752 - cygwin fails to work with wrapper
Summary: cygwin fails to work with wrapper
Status: RESOLVED DUPLICATE of bug 10664
Alias: None
Product: Ant
Classification: Unclassified
Component: Wrapper scripts (show other bugs)
Version: 1.5
Hardware: PC All
: P3 normal (vote)
Target Milestone: ---
Assignee: Ant Notifications List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-07-12 17:59 UTC by kostella
Modified: 2008-02-22 12:18 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kostella 2002-07-12 17:59:27 UTC
A recent (ahem) version of cygwin/cygpath fails to build the classpath used by the final line of 
the 'ant' wrapper script. This results in:

  Exception in thread "main" 
java.lang.NoClassDefFoundError: org/apache/tools/ant/Main

The problem seems to be 
that when assembling the list of jars, the jar paths are half dos and half unix and when 
concatenated together they do not make it through cygpath correctly. I got this as the classpath 
arg in the final line:

 C:\dev\ant/lib/xml-
apis.jar:C:\dev\ant/lib/xercesImpl.jar:C:\dev\ant/lib/optional.jar:C:\dev\ant/lib/ant.jar:/cygdrive/c/java/jdk1.3.1_03/jre/lib/rt.jar:/cygdrive/c/java/jdk1.3.1_03/lib/tools.jar

which 
is not a legal classpath on either platform.

I corrected the problem by forcing the 
individual jar paths to be unix paths instead of dos paths by modifying the 'ant' script 
thus:

line 125:
# add in the dependency .jar files in non-RPM mode (the default)
for i in 
"${ANT_LIB}"/*.jar
do
  #### CHANGE BEGINS HERE
  # For Cygwin, switch paths to unix format 
before converting back
  if $cygwin; then
    i=`cygpath --path --unix "$i"`
  fi
  #### CHANGE ENDS 
HERE
  # if the directory is empty, then it will return the input string

I'm not sure which 
version of cygwin is installed on the failing machine, but 
cygcheck shows this:

    Cygwin DLL 
version info:
        DLL version: 1.3.10
        DLL epoch: 19
        DLL bad signal mask: 19005
        DLL old 
termios: 5
        DLL malloc env: 28
        API major: 0
        API minor: 51
        Shared data: 3
        DLL identifier: 
cygwin1
        Mount registry: 2
        Cygnus registry name: Cygnus Solutions
        Cygwin registry name: 
Cygwin
        Program options name: Program Options
        Cygwin mount registry name: mounts v2
        
Cygdrive flags: cygdrive flags
        Cygdrive prefix: cygdrive prefix
        Cygdrive default 
prefix:
        Build date: Mon Feb 25 11:14:34 EST 2002
        Shared id: cygwin1S3
Comment 1 Stephane Bailliez 2002-07-12 18:37:53 UTC
4th one today :)

*** This bug has been marked as a duplicate of 10664 ***