mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
alternative jre: accept jdk path as valid jre; save system independent paths to enable path macros (sharing inside JDK team; common layout)
This commit is contained in:
@@ -239,13 +239,13 @@ public class JrePathEditor extends JPanel implements PanelWithAnchor {
|
||||
|
||||
@Override
|
||||
public void render(SimpleColoredComponent component, boolean selected) {
|
||||
component.append(getPresentableText());
|
||||
component.append(FileUtil.toSystemDependentName(getPresentableText()));
|
||||
component.setIcon(AllIcons.Nodes.Folder);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPresentableText() {
|
||||
return FileUtil.toSystemDependentName(myPath);
|
||||
return myPath;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -32,6 +32,7 @@ import com.intellij.openapi.projectRoots.ProjectJdkTable;
|
||||
import com.intellij.openapi.projectRoots.Sdk;
|
||||
import com.intellij.openapi.projectRoots.ex.PathUtilEx;
|
||||
import com.intellij.openapi.roots.*;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.PsiClass;
|
||||
@@ -56,6 +57,11 @@ public class JavaParametersUtil {
|
||||
Project project = configuration.getProject();
|
||||
Module module = ProgramParametersUtil.getModule(configuration);
|
||||
|
||||
String alternativeJrePath = configuration.getAlternativeJrePath();
|
||||
if (alternativeJrePath != null) {
|
||||
configuration.setAlternativeJrePath(ProgramParametersUtil.expandPath(alternativeJrePath, null, project));
|
||||
}
|
||||
|
||||
String vmParameters = configuration.getVMParameters();
|
||||
if (vmParameters != null) {
|
||||
vmParameters = ProgramParametersUtil.expandPath(vmParameters, module, project);
|
||||
@@ -156,10 +162,7 @@ public class JavaParametersUtil {
|
||||
return configuredJdk;
|
||||
}
|
||||
|
||||
if (JdkUtil.checkForJdk(jreHome)) {
|
||||
throw new CantRunException(ExecutionBundle.message("jre.path.is.jdk.error.message"));
|
||||
}
|
||||
if (!JdkUtil.checkForJre(jreHome)) {
|
||||
if (!JdkUtil.checkForJre(jreHome) && !JdkUtil.checkForJdk(jreHome)) {
|
||||
throw new CantRunException(ExecutionBundle.message("jre.path.is.not.valid.jre.home.error.message", jreHome));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user