So what's the JLex.jar present in xalan distro ?
---
The problem is in -static flag passed to Jlex.
In the JLex.jar (decompiled by jad), I've got :
public static void main(String args[])
throws IOException
{
int i;
for(i = 0; i < args.length && args[i].charAt(0) == '-'; i++)
if(args[i].equals("-static"))
staticFlag = true;
else
printUsage();
if(args.length - i < 1)
printUsage();
try
{
CLexGen clexgen = new CLexGen(args[i]);
clexgen.generate();
}
catch(Error error)
{
System.out.println(error.getMessage());
}
}
In JLex.jar 1.2.5 from site, in Main.java you got :
public static void main
(
String arg[]
)
throws java.io.IOException
{
CLexGen lg;
if (arg.length < 1)
{
System.out.println("Usage: JLex.Main <filename>");
return;
}
/* Note: For debuging, it may be helpful to remove the try/catch
block and permit the Exception to propagate to the top level.
This gives more information. */
try
{
lg = new CLexGen(arg[0]);
lg.generate();
}
catch (Error e)
{
System.out.println(e.getMessage());
}
}
}
BTW, there is still fix to be applied in build.xml, since ant try to
copy licence file which didn't exist and also didn't take care of
property name (bcel.jar...)
Licence copy should also see if the licence file exist...
Here a first patch to applied (against 2.3.1)
--- build.xml Tue Feb 19 23:33:34 2002
+++ build.xml Thu Jun 27 08:48:42 2002
@@ -155,6 +155,8 @@
<pathelement location="${xmlapis.jar}" />
<pathelement location="${parser.jar}" />
<pathelement location="${bsf.jar}" />
+ <pathelement location="${bcel.jar}" />
+ <pathelement location="${runtime.jar}" />
<pathelement location="${stylebook.jar}" />
<pathelement location="${doclet.jar}" />
<pathelement location="${build.xalan.jar}" />
@@ -388,36 +390,36 @@
<!-- copy the xsltc 3rd party support jar files and licenses
to tmp dist dir
-->
- <copy todir="${build.dir}/xsltctmp"
- file="${bin.dir}/BCEL.jar"/>
+ <copy tofile="${build.dir}/xsltctmp/${bcel.jar.name}"
+ file="${bcel.jar}"/>
<copy todir="${build.dir}/xsltctmp"
file="${bin.dir}/BCEL.LICENSE.txt"/>
<copy todir="${build.dir}/xsltctmp"
file="${bin.dir}/BCEL.README.txt"/>
- <copy todir="${build.dir}/xsltctmp"
- file="${bin.dir}/JLex.jar"/>
+ <copy tofile="${build.dir}/xsltctmp/${JLex.jar.name}"
+ file="${JLex.jar}"/>
<copy todir="${build.dir}/xsltctmp"
file="${bin.dir}/JLex.LICENSE.txt"/>
<copy todir="${build.dir}/xsltctmp"
file="${bin.dir}/JLex.README.txt"/>
- <copy todir="${build.dir}/xsltctmp"
- file="${bin.dir}/java_cup.jar"/>
+ <copy tofile="${build.dir}/xsltctmp/${java_cup.jar.name}"
+ file="${java_cup.jar}"/>
<copy todir="${build.dir}/xsltctmp"
file="${bin.dir}/java_cup.LICENSE.txt"/>
<copy todir="${build.dir}/xsltctmp"
file="${bin.dir}/java_cup.README.txt"/>
- <copy todir="${build.dir}/xsltctmp"
- file="${bin.dir}/runtime.jar"/>
+ <copy tofile="${build.dir}/xsltctmp/${runtime.jar.name}"
+ file="${runtime.jar}"/>
<copy todir="${build.dir}/xsltctmp"
file="${bin.dir}/runtime.LICENSE.txt"/>
<copy todir="${build.dir}/xsltctmp"
file="${bin.dir}/runtime.README.txt"/>
- <copy todir="${build.dir}/xsltctmp"
- file="${bin.dir}/regexp.jar"/>
+ <copy tofile="${build.dir}/xsltctmp/${regexp.jar.name}"
+ file="${regexp.jar}"/>
<copy todir="${build.dir}/xsltctmp"
file="${bin.dir}/regexp.LICENSE.txt"/>
<copy todir="${build.dir}/xsltctmp"
@@ -426,23 +428,23 @@
<!-- unjar all jars -->
<unjar src="${build.dir}/xsltctmp/xsltc.jar"
dest="${build.dir}/xsltctmp" />
- <unjar src="${build.dir}/xsltctmp/BCEL.jar"
+ <unjar src="${build.dir}/xsltctmp/${bcel.jar.name}"
dest="${build.dir}/xsltctmp" />
- <unjar src="${build.dir}/xsltctmp/JLex.jar"
+ <unjar src="${build.dir}/xsltctmp/${JLex.jar.name}"
dest="${build.dir}/xsltctmp" />
- <unjar src="${build.dir}/xsltctmp/java_cup.jar"
+ <unjar src="${build.dir}/xsltctmp/${java_cup.jar.name}"
dest="${build.dir}/xsltctmp" />
- <unjar src="${build.dir}/xsltctmp/runtime.jar"
+ <unjar src="${build.dir}/xsltctmp/${runtime.jar.name}"
dest="${build.dir}/xsltctmp" />
- <unjar src="${build.dir}/xsltctmp/regexp.jar"
+ <unjar src="${build.dir}/xsltctmp/${regexp.jar.name}"
dest="${build.dir}/xsltctmp" />
<!-- remove jar files -->
<delete file="${build.dir}/xsltctmp/xsltc.jar" />
- <delete file="${build.dir}/xsltctmp/BCEL.jar" />
- <delete file="${build.dir}/xsltctmp/JLex.jar" />
- <delete file="${build.dir}/xsltctmp/java_cup.jar" />
- <delete file="${build.dir}/xsltctmp/runtime.jar" />
+ <delete file="${build.dir}/xsltctmp/${bcel.jar.name}" />
+ <delete file="${build.dir}/xsltctmp/${JLex.jar.name}" />
+ <delete file="${build.dir}/xsltctmp/${java_cup.jar.name}" />
+ <delete file="${build.dir}/xsltctmp/${runtime.jar.name}" />
<!-- remove old META-INF dir -->
<delete dir="${build.dir}/xsltctmp/META-INF"