The LOCALCLASSPATH variable in the script is set to longer than 256 characters, making any reasonable cygwin basic install fail with: cygpath: error converting "/cygdrive/c/win2k/fop/lib/xmlgraphics-commons-1.0.jar:/cygdrive/c/win2k/fop/lib/xml-apis-1.3.02.jar:/cygdrive/c/win2k/fop/lib/xercesImpl-2.7.1.jar:/cygdrive/c/win2k/fop/lib/xalan-2.7.0.jar:/cygdrive/c/win2k/fop/lib/serializer-2.7.0.jar:/cygdrive/c/win2k/fop/lib/commons-logging-1.0.4.jar:/cygdrive/c/win2k/fop/lib/commons-io-1.1.jar:/cygdrive/c/win2k/fop/lib/batik-all-1.6.jar:/cygdrive/c/win2k/fop/lib/avalon-framework-4.2.0.jar:/cygdrive/c/win2k/fop/build/fop.jar:/cygdrive/c/win2k/fop/build/fop-sandbox.jar:/cygdrive/c/win2k/fop/build/fop-hyph.jar:" - File name too long Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/fop/cli/Main I have ant installed in the same directory, and it does not fail like this. The reason for this is that it has the ANT_LIB and ANT_HOME directories passed to it as properties, and (i guess) deals with the classpath issues internally.
Created attachment 18964 [details] alternative fop script Does this script solve the problem?
I do not run Cygwin here, so I cannot test this problem. Is it really true that cygpath has such a small upper limit to the path length? If so, can you test whether the attached script solves the problem? Simon
I can confirm the problem using cygpath on the long path value in the report above. However, I'm running fop.sh from a cygwin bash for years and didn't have a problem. I suspect it might be due to the /cygdrive/ prefix.
(In reply to comment #3) > I can confirm the problem using cygpath on the long path value in the report > above. However, I'm running fop.sh from a cygwin bash for years and didn't have > a problem. I suspect it might be due to the /cygdrive/ prefix. It will always hurt a person who installs fop under a long path name. Therefore we better try to prevent it. Can you test that the modified script at least does not make things worse, and hopefully resolves the problem?
Almost, but not quite ;) It now reports: Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/fop/cli/Main i guess the classpath is still a bit messed.
(In reply to comment #5) > It now reports: > Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/fop/cli/Main > > i guess the classpath is still a bit messed. Can you let me know the resulting class path? Is FOP_HOME set? Does $FOP_HOME/build/fop.jar exist?
LocalClasspath = c:/win2k/fop/lib/xmlgraphics-commons-1.0.jar:c:/win2k/fop/lib/xml-apis-1.3.02.jar:c:/win2k/fop/lib/xercesImpl-2.7.1.jar:c:/win2k/fop/lib/xalan-2.7.0.jar:c:/win2k/fop/lib/serializer-2.7.0.jar:c:/win2k/fop/lib/commons-logging-1.0.4.jar:c:/win2k/fop/lib/commons-io-1.1.jar:c:/win2k/fop/lib/batik-all-1.6.jar:c:/win2k/fop/lib/avalon-framework-4.2.0.jar:c:/win2k/fop/build/fop.jar;c;C:/cygwin/win2k/fop/build/fop-sandbox.jar;c;C:/cygwin/win2k/fop/build/fop-hyph.jar: Classpath = fop_home = c:/win2k/fop fop_exec_command = exec "/cygdrive/c/win2k/Java/jdk1.5.0_04/bin/java" -classpath "c:/win2k/fop/lib/xmlgraphics-commons-1.0.jar:c:/win2k/fop/lib/xml-apis-1.3.02.jar:c:/win2k/fop/lib/xercesImpl-2.7.1.jar:c:/win2k/fop/lib/xalan-2.7.0.jar:c:/win2k/fop/lib/serializer-2.7.0.jar:c:/win2k/fop/lib/commons-logging-1.0.4.jar:c:/win2k/fop/lib/commons-io-1.1.jar:c:/win2k/fop/lib/batik-all-1.6.jar:c:/win2k/fop/lib/avalon-framework-4.2.0.jar:c:/win2k/fop/build/fop.jar;c;C:/cygwin/win2k/fop/build/fop-sandbox.jar;c;C:/cygwin/win2k/fop/build/fop-hyph.jar:" org.apache.fop.cli.Main Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/fop/cli/Main My guess is that it is not recognising the path separation as windoes, i.e. c:/ should be c:\
I think your last trial failed because you used : as path separator. Even though you are in cygwin, the java.exe is the windows version. It expects ; as path separator. To make CLASSPATH work on my cygwin installation, I have to use this style: $ export CLASSPATH="c:/library_home/bopiler.jar;c:/library_home/junit/junit4/ju nit-4.1.jar" Either with forward or backward slashes. Using it without quotes fails; using : in stead of ; fails using /cygdrive/c/... fails. But, Cygwin has a tool called cygpath, that translates your UNIX-style classpath to windows path. See link: <http://www.ics.uci.edu/~ics185/projects/project0/faq1.html> Regards, Jan
Created attachment 18974 [details] alternative fop script One more try, with ';' as the path separator. If this does not work, I will defer to a seasoned Cygwin user.
Nope, not quite. Change PATH_SEPARATOR=; to PATH_SEPARATOR=";" and it works.
Created attachment 18995 [details] another alternative fop script This script was provided by Mark C. Allman. I builds the Unix path, but with semicolons instead of colons. Then it applies cygpath as before. This will cause cygpath to convert the path in pieces, and avoid length problems. This is a simpler solution than mine. Please, test.
FWIW it was the technique i attempted when i first tried to hack it. both work fine. Fop - last script: local class path: c:/win2k/fop/lib/xmlgraphics-commons-1.0.jar;c:/win2k/fop/lib/xml-apis-1.3.02.jar;c:/win2k/fop/lib/xercesImpl-2.7.1.jar;c:/win2k/fop/lib/xlan-2.7.0.jar;c:/win2k/fop/lib/serializer-2.7.0.jar;c:/win2k/fop/lib/commons-logging-1.0.4.jar;c:/win2k/fop/lib/commons-io-1.1.jar;c:/win2k/fop/lib/batik-all-1.6.jar;c:/win2k/fop/lib/avalon-framework-4.2.0.jar;c:/win2k/fop/build/fop.jar;c;C:/cygwin/win2k/fop/build/fop-sandbox.jar;c;C:/cygwin/win2k/fop/build/fop-hyph.jar; Fopish - new script: local class path: c:/win2k/fop/lib/xmlgraphics-commons-1.0.jar;c:/win2k/fop/lib/xml-apis-1.3.02.jar;c:/win2k/fop/lib/xercesImpl-2.7.1.jar;c:/win2k/fop/lib/xalan-2.7.0.jar;c:/win2k/fop/lib/serializer-2.7.0.jar;c:/win2k/fop/lib/commons-logging-1.0.4.jar;c:/win2k/fop/lib/commons-io-1.1.jar;c:/win2k/fop/lib/batik-all-1.6.jar;c:/win2k/fop/lib/avalon-framework-4.2.0.jar;c:/win2k/fop/build/fop.jar;c:/win2k/fop/build/fop-sandbox.jar;c:/win2k/fop/build/fop-hyph.jar as you can see, the new one adds the last two jars correctly. Done IMHO, but will leave for someone else to close.
Patch by Mark C. Allman applied in revision 463578.
batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed