Search in sources :

Example 1 with GetJPDADialog

use of com.intellij.debugger.ui.GetJPDADialog in project intellij-community by JetBrains.

the class DebuggerManagerImpl method checkTargetJPDAInstalled.

/* Remoting */
private static void checkTargetJPDAInstalled(JavaParameters parameters) throws ExecutionException {
    final Sdk jdk = parameters.getJdk();
    if (jdk == null) {
        throw new ExecutionException(DebuggerBundle.message("error.jdk.not.specified"));
    }
    final JavaSdkVersion version = JavaSdk.getInstance().getVersion(jdk);
    String versionString = jdk.getVersionString();
    if (version == JavaSdkVersion.JDK_1_0 || version == JavaSdkVersion.JDK_1_1) {
        throw new ExecutionException(DebuggerBundle.message("error.unsupported.jdk.version", versionString));
    }
    if (SystemInfo.isWindows && version == JavaSdkVersion.JDK_1_2) {
        final VirtualFile homeDirectory = jdk.getHomeDirectory();
        if (homeDirectory == null || !homeDirectory.isValid()) {
            throw new ExecutionException(DebuggerBundle.message("error.invalid.jdk.home", versionString));
        }
        //noinspection HardCodedStringLiteral
        File dllFile = new File(homeDirectory.getPath().replace('/', File.separatorChar) + File.separator + "bin" + File.separator + "jdwp.dll");
        if (!dllFile.exists()) {
            GetJPDADialog dialog = new GetJPDADialog();
            dialog.show();
            throw new ExecutionException(DebuggerBundle.message("error.debug.libraries.missing"));
        }
    }
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) JavaSdkVersion(com.intellij.openapi.projectRoots.JavaSdkVersion) JavaSdk(com.intellij.openapi.projectRoots.JavaSdk) Sdk(com.intellij.openapi.projectRoots.Sdk) ExecutionException(com.intellij.execution.ExecutionException) VirtualFile(com.intellij.openapi.vfs.VirtualFile) File(java.io.File) GetJPDADialog(com.intellij.debugger.ui.GetJPDADialog)

Aggregations

GetJPDADialog (com.intellij.debugger.ui.GetJPDADialog)1 ExecutionException (com.intellij.execution.ExecutionException)1 JavaSdk (com.intellij.openapi.projectRoots.JavaSdk)1 JavaSdkVersion (com.intellij.openapi.projectRoots.JavaSdkVersion)1 Sdk (com.intellij.openapi.projectRoots.Sdk)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 File (java.io.File)1