Discussion:
exec task fails for service account
Sebastian Götz
2017-01-17 08:03:48 UTC
Permalink
Hi guys,

I have some troule with my ANT build.
We just migrated our CI-Server (Jenkins) to a new machine. The former
was a Windows Server 2008 R2 and now we have a Windows 10 machine.
After installing Jenkins and ANT and Java and all the other stuff and
restoring the configuration backup I can run my builds again.
But until now I face the problem that an exec tasks in a very early
stage of the build script fails with the following message:

Execute failed: java.io.IOException: Cannot run program "javac" (in
directory "C:\Program Files\Java\jdk1.8.0_111\bin"): CreateProcess error=2

This means that he target file simple does not exists, which is not the
truth since I can navigate to the installation folder of the JDK and see
that there is a javac.exe.
Moreover if I run the same build script from the same location (the
Jenkins workspace folder of the job) manually as user, the exec tasks
succeeds.
The section in the build script looks like this:

<!-- determine actual compiler version -->
<exec executable="javac" dir="${env.JDK_HOME}/bin">
<arg value="-version" />
<redirector outputproperty="compiler.version">
<outputfilterchain>
<tokenfilter>
<replacestring from="javac"/>
<trim/>
</tokenfilter>
</outputfilterchain>
</redirector>
</exec>

The environment variable JDK_HOME points to C:\Program
Files\Java\jdk1.8.0_111.
The application server Jenkins is running in (Tomcat 8.5.9) is running
under the "Local System Account" as services do by default.

Any ideas what this is all about?
--
Best regards,

Sebastian


---------------------------------------------------------------------
To unsubscribe, e-mail: user-***@ant.apache.org
For additional commands, e-mail: user-***@ant.apache.org
Continue reading on narkive:
Loading...