Bug 28226

Summary: Ant does not start in OS/2
Product: Ant Reporter: Zdenek Wagner <wagner>
Component: CoreAssignee: Ant Notifications List <notifications>
Status: CLOSED FIXED    
Severity: critical CC: notifications
Priority: P3    
Version: 1.6.1   
Target Milestone: 1.6.2   
Hardware: PC   
OS: OS/2   
Attachments: Diff file mentioned in the bug description
zipped patch files

Description Zdenek Wagner 2004-04-06 09:49:12 UTC
Launching Ant 1.6.1 in OS/2 no longer works. The current launch script ignores
all ant-*.jar because their contents were present also in ant.jar and the
CLASSPATH would be too long. However, ant.jar now contains only empty directory
org/apache/tools/ant/launch. If it is intentional, please replace bin/antenv.cmd
with the version available from http://hroch486.icpf.cas.cz/antbugreport/ -- the
zip file contains the new version as well as the "diff -u" file.
Comment 1 Zdenek Wagner 2004-04-06 09:54:17 UTC
Created attachment 11150 [details]
Diff file mentioned in the bug description
Comment 2 Stefan Bodewig 2004-04-06 12:20:22 UTC
Thank you Zdenek,

actually, Ant 1.6 should only require ant-launcher.jar on the classpath and nothing
else.  Can you please verify whether restricting the script to the launcher jar
without having ant.jar or optional.jar (which doesn't exist anymore anyway) works?
Comment 3 Zdenek Wagner 2004-04-06 13:52:06 UTC
Yes, it works, but it is necessary to use the
org.apache.tools.ant.launch.Launcher entry point. Another possibility is to use
java -jar $ANT_HOME\lib\ant-launcher.jar and in this case CLASSPATH may be
empty. It is only better to include tools.jar. I tried Java 1.4.1 from Golden
Code and Java 1.4.2 from Innotek, both can locate tools.jar according to
JAVA_HOME. I am not sure about Java from IBM (it is not free). Anyway, it would
be necessary to change ant.cmd. Should I rewrite it using the -jar option? Other
*.cmd will not be generally needed but they provide some added value.
Comment 4 Stefan Bodewig 2004-04-06 14:13:55 UTC
-jar ant-launcher.jar is fine with me, if it works.  And you are probably the only
one who knows 8-)
Comment 5 Zdenek Wagner 2004-04-06 15:00:29 UTC
OK, -jar ant-launcher.jar works in Linux too. Can you guarantee that
META-INF/MANIFEST.MF will always contain Main-Class:
org.apache.tools.ant.launch.Launcher? I will now thoroughly examine that I do
not spoil something and I will send updated scripts tomorrow.
Comment 6 Zdenek Wagner 2004-04-09 07:29:17 UTC
I am writing these comments because I think that it should be recorded somewhere.

1. Both Java 1.4.1 from Golden Code and 1.4.2 from Innotek contain tools.jar in
$JAVA_HOME/lib but it is searched in $JAVA_HOME/jre/lib although the former is
on CLASSPATH. i made a copy of tools.jar in the latter directory.

2. If Ant is launched via java -jar $ANT_HOME\lib\ant-launcher.jar, it is unable
to invoke Saxon through JAXP. It complains that its TransformerFactoryImpl
cannot be found. If $ANT_HOME\lib\ant-launcher.jar is on CLASSPATH and Ant is
launched via its entry point org.apache.tools.ant.launch.Launcher, Saxon works fine.
Comment 7 Zdenek Wagner 2004-04-14 08:05:15 UTC
Created attachment 11225 [details]
zipped patch files
Comment 8 Zdenek Wagner 2004-04-14 08:12:35 UTC
The zip file submitted on 04/14/04 08:05 contains patches to ant.cmd and
antenv.cmd. Ant is invoked via entry point org.apache.tools.ant.launch.Launcher
in ant-launcher.jar. I have tried my existing ant files. I have tested mainly
OS/2 specific tasks <apply>, <exec> and setting properties from environment
variables, running <java>, <javac> and <javadoc> and invoking Saxon from <xslt>
by setting system property
-Djavax.xml.transform.TransformerFactory=com.icl.saxon.TransformerFactoryImpl
Comment 9 Stefan Bodewig 2004-04-14 15:39:40 UTC
I think I've applied all patches (they initially failed since parts of the files
had the wrong line-ends) - could you please verify that I didn't mess up anything?
Comment 10 Zdenek Wagner 2004-04-15 11:10:04 UTC
The version, which is now on CVS, works fine.

Anyway, Rexx in OS/2 strictly requires DOS line endings but your working copy
from CVS should use line endings of your OS, CVS will handle it. Even zip/unzip
converts line endings, thus if the binary distribution is zipped on Linux, it
will unzip correctly in OS/2.
Comment 11 Stefan Bodewig 2004-04-15 11:21:44 UTC
OK, thank you for verifying.

I know about the line-ends 8-)  When I committed your original files I didn't
notice they contained cariage-returns - and I work on Linux.  So they were wrong
in CVS.

When we build a distribution of Ant, all .bat and .cmd files inside the bin
directory explicitly get cariage-returns added and .sh files get the removed
via <fixcrlf>.