Issue
I am trying to compile my project using JDK11 ( it used to be on JDK8 ), and during compilation process I get following error C:\dev\project\src\project\build.project.xml:715: Execute failed: java.io.IOException: Cannot run program "xjc" (in directory "C:\dev\project\src\project"): CreateProcess error=2, The system cannot find the file specified
I tried looking for solution online but many of the thread say it was a bug and that it was fixed, sadly I assume they are referring to JDK8 not JDK11 or something considering timestamp on comments. Does anyone had issue like this and is there any workaround while using JDK11 ? Thanks !
Solution
Okay so basically issue what that while using ant to build the issue because some things were removed from JDK11, JAXB and following jars that are required for that to work needed to be added in ants LIB folder. Here is the list of the jars:
*activation-1.1.1
*istack-commons-runtime-3.0.7
*jaxb-api-2.2
*jaxb-impl-2.2.11
*jaxb-runtime-2.4.0-b180830.0438
There were also one taskdef I needed to add in my XML in order to call that "XJC" that was complaining in the first place, but after that it passed
<taskdef name="xjc" classname="com.sun.tools.xjc.XJCTask">
<classpath>
<fileset dir="${core.lib-ivy}/jar" includes="*.jar"/>
</classpath>
</taskdef>
Answered By - zawarudo
Answer Checked By - David Goodson (JavaFixing Volunteer)