java: Updated macOS Java Path detector and docs to current JDK file structure (#1031)
This commit is contained in:
@@ -513,14 +513,14 @@
|
||||
<pre><path_to_jre>/bin/client/jvm.dll</pre>
|
||||
|
||||
<h3>macOS</h3>
|
||||
<p>The Java Runtime Library (called <code>libjli.dylib</code>) can be found inside of your JRE install folder. Run the following command in your terminal to find the location of your default Java installation:</p>
|
||||
<p>The Java Runtime Library (called <code>libjli.dylib</code>) can be found inside of your JDK install folder. Run the following command in your terminal to find the location of your default Java installation:</p>
|
||||
<pre>/usr/libexec/java_home</pre>
|
||||
|
||||
<p>This should give you a path looking like this:</p>
|
||||
<pre>/Library/Java/JavaVirtualMachines/<jdk_version>/Contents/Home</pre>
|
||||
|
||||
The <code>"libjli.dylib"</code> should be available at:
|
||||
<pre>/Library/Java/JavaVirtualMachines/<jdk_version>/Contents/Home/jre/lib/jli/libjvm.dylib</pre>
|
||||
<pre>/Library/Java/JavaVirtualMachines/<jdk_version>/Contents/MacOS/libjli.dylib</pre>
|
||||
|
||||
<p>Insert the full path to <code>libjli.dylib</code> into the <strong>Java Path</strong> setting in the <a href="#PreferencesWindow">Preferences Window</a>.</p>
|
||||
|
||||
|
||||
@@ -358,7 +358,7 @@ void QtProjectWizardContentPreferences::populate(QGridLayout* layout, int& row)
|
||||
m_javaPath->setFileFilter(
|
||||
QStringLiteral("JLI or JVM Library (libjli.dylib libjvm.dylib)"));
|
||||
m_javaPath->setPlaceholderText(
|
||||
QStringLiteral("<jre_path>/Contents/Home/jre/lib/jli/libjli.dylib"));
|
||||
QStringLiteral("/Library/Java/JavaVirtualMachines/<jdk_version>/Contents/MacOS/libjli.dylib"));
|
||||
break;
|
||||
case OS_LINUX:
|
||||
m_javaPath->setFileFilter(QStringLiteral("JVM Library (libjvm.so)"));
|
||||
|
||||
@@ -18,6 +18,16 @@ std::vector<FilePath> JavaPathDetectorMac::doGetPaths() const
|
||||
std::string output = utility::executeProcess(command.c_str()).second;
|
||||
|
||||
if (!output.empty())
|
||||
{
|
||||
javaPath = FilePath(utility::trim(output) + "/../MacOS/libjli.dylib").makeCanonical();
|
||||
}
|
||||
|
||||
if (!javaPath.exists() && output.size())
|
||||
{
|
||||
javaPath = FilePath(utility::trim(output) + "/lib/libjli.dylib");
|
||||
}
|
||||
|
||||
if (!javaPath.exists() && output.size())
|
||||
{
|
||||
javaPath = FilePath(utility::trim(output) + "/jre/lib/jli/libjli.dylib");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user