check for java installs in PATH on windows
this should find java installs from scoop as well as any other installer, that registers java in the PATH environment variable. Signed-off-by: Tayou <tayou@gmx.net>
This commit is contained in:
parent
ab766a0598
commit
bb4861cf0d
@ -177,6 +177,12 @@ QStringList addJavasFromEnv(QList<QString> javas)
|
||||
QByteArray env = qgetenv("POLYMC_JAVA_PATHS");
|
||||
#if defined(Q_OS_WIN32)
|
||||
QList<QString> javaPaths = QString::fromLocal8Bit(env).replace("\\", "/").split(QLatin1String(";"));
|
||||
|
||||
QByteArray envPath = qgetenv("PATH");
|
||||
QList<QString> javaPathsfromPath = QString::fromLocal8Bit(envPath).replace("\\", "/").split(QLatin1String(";"));
|
||||
for (QString string : javaPathsfromPath) {
|
||||
javaPaths.append(string + "/javaw.exe");
|
||||
}
|
||||
#else
|
||||
QList<QString> javaPaths = QString::fromLocal8Bit(env).split(QLatin1String(":"));
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user