Agent startup fails with message "The system cannot find the file specified. (0x2)"
Problem
When starting a Bamboo Remote Agent, the startup process fails, reporting the following messages in the <bamboo-agent-home>/atlassian-bamboo-agent.log
:
FATAL | wrapper | 2011/04/30 17:18:35 | Unable to execute Java command. The system cannot find the file specified. (0x2)
FATAL | wrapper | 2011/04/30 17:18:35 | Critical error: wait for JVM process failed
ERROR | wrapper | 2011/04/30 17:18:36 | The Bamboo build server service was launched, but failed to start.
Cause
Environment variables PATH, JAVA_HOME, JAVA_JDK
or JAVA_JRE
are pointing to the Java version distributed with Windows at C:\Windows\System32
. This version of Java does not work correctly with the Agent Wrapper.
Resolution
In the remote agent machine, download and install a supported JDK version and make sure that the Windows environment variables are pointing to it.
- Check the
JAVA_HOME/JAVA_JDK/JAVA_JRE
variables. - Check the
PATH
environment variable definition and ensure that the correct Java JDK is defined before thec:\windows\system32
part.
Alternatively, if just setting the variables does not work, please:
Edit the property wrapper.java.command located in the file
<bamboo-agent-home>/conf/wrapper.conf
so that it points to the Sun JDK Java binary file:wrapper.java.command=%JAVA_HOME%/bin/java
- Restart the Agent.