Skip to content

Commit

Permalink
[569513] Setting up platform-ui SDK environment fails.
Browse files Browse the repository at this point in the history
  • Loading branch information
merks committed Jan 11, 2021
1 parent 5712489 commit dda7c66
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 17 deletions.
2 changes: 1 addition & 1 deletion features/org.eclipse.oomph.setup.core-feature/feature.xml
Expand Up @@ -12,7 +12,7 @@
<feature
id="org.eclipse.oomph.setup.core"
label="%featureName"
version="1.18.0.qualifier"
version="1.19.0.qualifier"
provider-name="%providerName"
license-feature="org.eclipse.oomph.license"
license-feature-version="0.0.0">
Expand Down
2 changes: 1 addition & 1 deletion features/org.eclipse.oomph.setup.core-feature/pom.xml
Expand Up @@ -20,6 +20,6 @@
</parent>
<groupId>org.eclipse.oomph.features</groupId>
<artifactId>org.eclipse.oomph.setup.core</artifactId>
<version>1.18.0-SNAPSHOT</version>
<version>1.19.0-SNAPSHOT</version>
<packaging>eclipse-feature</packaging>
</project>
6 changes: 3 additions & 3 deletions plugins/org.eclipse.oomph.setup.core/META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.oomph.setup.core;singleton:=true
Bundle-Version: 1.18.0.qualifier
Bundle-Version: 1.19.0.qualifier
Bundle-ClassPath: .
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Expand Down Expand Up @@ -39,7 +39,7 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
org.eclipse.core.net;bundle-version="[1.2.0,2.0.0)"
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ActivationPolicy: lazy
Export-Package: org.eclipse.oomph.setup.internal.core;version="1.18.0";x-internal:=true,
org.eclipse.oomph.setup.internal.core.util;version="1.18.0";x-internal:=true
Export-Package: org.eclipse.oomph.setup.internal.core;version="1.19.0";x-internal:=true,
org.eclipse.oomph.setup.internal.core.util;version="1.19.0";x-internal:=true
Bundle-Activator: org.eclipse.oomph.setup.internal.core.SetupCorePlugin$Implementation
Automatic-Module-Name: org.eclipse.oomph.setup.core
2 changes: 1 addition & 1 deletion plugins/org.eclipse.oomph.setup.core/pom.xml
Expand Up @@ -20,7 +20,7 @@
</parent>
<groupId>org.eclipse.oomph</groupId>
<artifactId>org.eclipse.oomph.setup.core</artifactId>
<version>1.18.0-SNAPSHOT</version>
<version>1.19.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>

<build>
Expand Down
Expand Up @@ -72,6 +72,7 @@
import org.eclipse.oomph.setup.util.SetupUtil;
import org.eclipse.oomph.setup.util.StringExpander;
import org.eclipse.oomph.util.CollectionUtil;
import org.eclipse.oomph.util.IORuntimeException;
import org.eclipse.oomph.util.IOUtil;
import org.eclipse.oomph.util.MonitorUtil;
import org.eclipse.oomph.util.OS;
Expand Down Expand Up @@ -260,6 +261,8 @@ public class SetupTaskPerformer extends AbstractSetupTaskContext

private boolean hasSuccessfullyPerformed;

private boolean hasProductIniVMArg;

private File logFile;

public SetupTaskPerformer(URIConverter uriConverter, SetupPrompter prompter, Trigger trigger, SetupContext setupContext, Stream stream)
Expand All @@ -280,6 +283,11 @@ public String getVMPath()
return getPrompter().getVMPath();
}

public boolean hasProductIniVMArg()
{
return hasProductIniVMArg;
}

public boolean hasSuccessfullyPerformed()
{
return hasSuccessfullyPerformed;
Expand Down Expand Up @@ -3722,6 +3730,21 @@ private void performPostBootstrapTasks(IProgressMonitor monitor) throws Exceptio
{
monitor.worked(1);
}

File iniFile = new File(getProductLocation(), getLauncherName() + ".ini"); //$NON-NLS-1$
if (iniFile.exists())
{
try
{
// Read the existing ini file with the system's default encoding, like the native launcher does.
List<String> contents = IOUtil.readLines(iniFile, null);
hasProductIniVMArg = contents.contains("-vm"); //$NON-NLS-1$
}
catch (IORuntimeException ex)
{
//$FALL-THROUGH$
}
}
}

private void performTriggeredSetupTasks(IProgressMonitor monitor) throws Exception
Expand Down
Expand Up @@ -12,7 +12,7 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
org.eclipse.emf.edit.ui;bundle-version="[2.10.0,3.0.0)",
org.eclipse.oomph.setup;bundle-version="[1.18.0,2.0.0)",
org.eclipse.oomph.setup.edit;bundle-version="[1.15.0,2.0.0)",
org.eclipse.oomph.setup.ui;bundle-version="[1.19.0,2.0.0)",
org.eclipse.oomph.setup.ui;bundle-version="[1.20.0,2.0.0)",
org.eclipse.equinox.p2.operations;bundle-version="[2.0.0,3.0.0)",
org.eclipse.equinox.p2.metadata;bundle-version="[2.0.0,3.0.0)",
org.eclipse.equinox.p2.core;bundle-version="[2.0.0,3.0.0)",
Expand All @@ -26,7 +26,7 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
org.eclipse.oomph.ui;bundle-version="[1.15.0,2.0.0)",
org.eclipse.oomph.p2.ui;bundle-version="[1.15.0,2.0.0)",
org.eclipse.oomph.setup.p2;bundle-version="[1.16.0,2.0.0)",
org.eclipse.oomph.setup.core;bundle-version="[1.18.0,2.0.0)",
org.eclipse.oomph.setup.core;bundle-version="[1.19.0,2.0.0)",
org.eclipse.oomph.jreinfo.ui;bundle-version="[1.12.0,2.0.0)",
org.eclipse.help;bundle-version="[3.5.0,4.0.0)",
org.eclipse.ui.net;bundle-version="[1.0.0,2.0.0)",
Expand Down
16 changes: 8 additions & 8 deletions plugins/org.eclipse.oomph.setup.ui/META-INF/MANIFEST.MF
Expand Up @@ -2,17 +2,17 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.oomph.setup.ui;singleton:=true
Bundle-Version: 1.19.0.qualifier
Bundle-Version: 1.20.0.qualifier
Bundle-ClassPath: .
Bundle-Activator: org.eclipse.oomph.setup.ui.SetupUIPlugin$Implementation
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Export-Package: org.eclipse.oomph.setup.ui;version="1.19.0";x-internal:=true,
org.eclipse.oomph.setup.ui.actions;version="1.19.0";x-internal:=true,
org.eclipse.oomph.setup.ui.recorder;version="1.19.0";x-internal:=true,
org.eclipse.oomph.setup.ui.synchronizer;version="1.19.0";x-internal:=true,
org.eclipse.oomph.setup.ui.wizards;version="1.19.0";x-internal:=true
Export-Package: org.eclipse.oomph.setup.ui;version="1.20.0";x-internal:=true,
org.eclipse.oomph.setup.ui.actions;version="1.20.0";x-internal:=true,
org.eclipse.oomph.setup.ui.recorder;version="1.20.0";x-internal:=true,
org.eclipse.oomph.setup.ui.synchronizer;version="1.20.0";x-internal:=true,
org.eclipse.oomph.setup.ui.wizards;version="1.20.0";x-internal:=true
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
org.eclipse.core.expressions;bundle-version="[3.4.0,4.0.0)",
org.eclipse.core.filesystem;bundle-version="[1.0.0,2.0.0)",
Expand All @@ -26,14 +26,14 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
org.eclipse.nebula.widgets.tablecombo;bundle-version="[1.0.0,2.0.0)",
org.eclipse.emf.ecore.xmi;bundle-version="[2.10.0,3.0.0)";visibility:=reexport,
org.eclipse.emf.edit.ui;bundle-version="[2.10.0,3.0.0)";visibility:=reexport,
org.eclipse.oomph.setup.core;bundle-version="[1.18.0,2.0.0)";visibility:=reexport,
org.eclipse.oomph.setup.core;bundle-version="[1.19.0,2.0.0)";visibility:=reexport,
org.eclipse.oomph.setup.edit;bundle-version="[1.15.0,2.0.0)";visibility:=reexport,
org.eclipse.oomph.setup.p2.edit;bundle-version="[1.13.0,2.0.0)",
org.eclipse.oomph.setup.sync;bundle-version="[1.13.0,2.0.0)",
org.eclipse.oomph.ui;bundle-version="[1.15.0,2.0.0)",
org.eclipse.oomph.p2.edit;bundle-version="[1.14.0,2.0.0)";visibility:=reexport,
org.eclipse.oomph.p2.core;bundle-version="[1.17.0,2.0.0)",
org.eclipse.oomph.p2.ui;bundle-version="[1.14.0,2.0.0)",
org.eclipse.oomph.p2.ui;bundle-version="[1.15.0,2.0.0)",
org.eclipse.oomph.jreinfo.ui;bundle-version="[1.12.0,2.0.0)",
org.eclipse.oomph.preferences;bundle-version="[1.12.0,2.0.0)"
Bundle-ActivationPolicy: lazy
Expand Down
2 changes: 1 addition & 1 deletion plugins/org.eclipse.oomph.setup.ui/pom.xml
Expand Up @@ -20,7 +20,7 @@
</parent>
<groupId>org.eclipse.oomph</groupId>
<artifactId>org.eclipse.oomph.setup.ui</artifactId>
<version>1.19.0-SNAPSHOT</version>
<version>1.20.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>

<build>
Expand Down
Expand Up @@ -14,6 +14,8 @@
import org.eclipse.oomph.internal.setup.SetupProperties;
import org.eclipse.oomph.internal.ui.AccessUtil;
import org.eclipse.oomph.internal.ui.OomphAdapterFactoryContentProvider;
import org.eclipse.oomph.jreinfo.JRE;
import org.eclipse.oomph.jreinfo.JREManager;
import org.eclipse.oomph.p2.core.CertificateConfirmer;
import org.eclipse.oomph.setup.CertificatePolicy;
import org.eclipse.oomph.setup.Installation;
Expand Down Expand Up @@ -1090,6 +1092,22 @@ public static boolean launchProduct(SetupTaskPerformer performer) throws Excepti
File executable = info.getExecutable();
command.add(executable.toString());

// This is to ensure that if there is no -vm argument, the product should be launched with the system JRE and not the JRE of the installer,
// which is likely a minimized JustJ JRE.
if (!performer.hasProductIniVMArg())
{
JRE systemJRE = JREManager.INSTANCE.getSystemJRE();
if (systemJRE != null)
{
File javaHome = systemJRE.getJavaHome();
if (javaHome != null)
{
command.add("-vm"); //$NON-NLS-1$
command.add(new File(javaHome, "bin").toString()); //$NON-NLS-1$
}
}
}

File ws = performer.getWorkspaceLocation();
if (ws != null)
{
Expand Down

0 comments on commit dda7c66

Please sign in to comment.