Commit 97c5c835 authored by Andrew Goodbody's avatar Andrew Goodbody
Browse files

Check for and use bundled JRE for jAlbum export if present

Add a check for the bundled Java Runtime Environment that is sometimes
shipped with jAlbum packages. This JRE will contain all required
dependencies for jAlbum when the system JRE may be missing some. If
found invoke jave from this bundled JRE.
If the bundled JRE cannot be found fallback to the system JRE which
was the behaviour before this commit.
parent ad503c2a
......@@ -226,6 +226,17 @@ void JAlbumWindow::slotNewAlbum()
settingsFile.close();
QString javaExecutable;
QDir jrePath = QFileInfo(d->jalbum->jarPath().path()).dir();
if (jrePath.cd(QString::fromLatin1("jre64/bin/")))
{
javaExecutable = jrePath.filePath(QString::fromLatin1("java"));
}
else
{
javaExecutable = QString::fromLatin1("java");
}
QStringList args;
args.append(QString::fromLatin1("-Xmx400M"));
args.append(QString::fromLatin1("-jar"));
......@@ -234,7 +245,7 @@ void JAlbumWindow::slotNewAlbum()
QProcess process;
process.setProcessEnvironment(adjustedEnvironmentForAppImage());
process.startDetached(QString::fromLatin1("java"), args);
process.startDetached(javaExecutable, args);
accept();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment