I tried to compile java code, but I got the error:
Caused by: java.io.IOException: Cannot run program "C:\jdk\bin\javac": CreateProcess error=206, The filename or extension is too long.
This is the content of my build file:
I think maybe my classpath: ${was_cp} is too long. How can I fix this ?
解决方案
The problem isn't that your classpath is too large. It's that you're converting into one gigantic string. Simply use the classpathref attribute instead:
fork="yes"
executable="${java.home}/bin/javac"
compiler="javac1.6"
includeantruntime="false"
encoding="utf-8"
srcdir="${workspace}/${project.name}/src"
destdir="${workspace}/${project.name}/WebContent/WEB-INF/classes"
classpathref="was.runtime"
/>