Android: Support non distro installations of JDK

The android tools expect to find java and javac in the PATH. Which
is the case on using the distro java, but isn't if the user
installs Oracle's binary jdk distribution.

Change-Id: Ib5f5448724f00b000a969c27d5aad6a420bfc1eb
Task-number: QTCREATORBUG-14155
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
This commit is contained in:
Daniel Teske
2015-09-09 16:40:12 +02:00
parent 9d162bdb16
commit 9f2f41e285

View File

@@ -471,8 +471,12 @@ FileName AndroidConfig::adbToolPath() const
Environment AndroidConfig::androidToolEnvironment() const Environment AndroidConfig::androidToolEnvironment() const
{ {
Environment env = Environment::systemEnvironment(); Environment env = Environment::systemEnvironment();
if (!m_openJDKLocation.isEmpty()) if (!m_openJDKLocation.isEmpty()) {
env.set(QLatin1String("JAVA_HOME"), m_openJDKLocation.toUserOutput()); env.set(QLatin1String("JAVA_HOME"), m_openJDKLocation.toUserOutput());
Utils::FileName binPath = m_openJDKLocation;
binPath.appendPath(QLatin1String("bin"));
env.prependOrSetPath(binPath.toUserOutput());
}
return env; return env;
} }