2016-08-24 59 views
1

我试图进入JDK源代码,但本地JDK和远程JDK的版本不同,因此行号不匹配。我已经下载了远程JDK的源代码,但是我找不到如何告诉IntelliJ使用它们。IntelliJ - 在调试时选择源代码位置

如何告诉IntelliJ使用特定的JDK源进行调试?

+1

你能不只是下载远程,将它添加到你的地方,并使用它? – ChiefTwoPencils

+0

我正在调试JVM更新后破坏的云应用程序。我已经下载了JVM和它的源代码,但是我找不到如何告诉intellij使用它。我的想法是使用捆绑的JVM 8作为想法下载的一部分,而我的应用程序使用Java 7.我也不想与其他JDK一起运行Idea,因为它不支持任何GUI。 –

+1

设置项目JDK:https://www.jetbrains.com/help/idea/2016.2/configuring-global-project-and-module-sdks.html – Mark

回答

1

您可以在此基础上你的JDK 设置

https://www.jetbrains.com/help/idea/2016.2/configuring-global-project-and-module-sdks.html

To configure a project SDK 

    Open the Project Structure dialog (e.g. Ctrl+Shift+Alt+S). 
    In the left-hand pane, under Project Settings, click Project. 
    On the page that opens in the right-hand part of the dialog, select the necessary SDK from the Project SDK list. 
    If the desired SDK is not present in the list, click New and select the necessary SDK type. 
    In the dialog that opens, select the SDK home directory and click OK. 

    As a result, a new SDK is added to IntelliJ IDEA and selected as the project SDK. 
    To view or edit the SDK name and contents, click Edit. (The SDK page will open.) 
    Click OK in the Project Structure dialog. 

To configure a module SDK 

    Open the Project Structure dialog (e.g. Ctrl+Shift+Alt+S). 
    In the left-hand pane, under Project Settings, click Modules. 
    In the area under project_structure_toolbar_2_modules, select the module of interest. 
    In the right-hand part of the dialog, on the Module page, select the Dependencies tab. 
    Select the SDK from the Module SDK list. (To select the project SDK, select Project SDK. Note that if you change the project SDK later, the module SDK will change accordingly.) 
    If the desired SDK is not present in the list, click New and select the necessary SDK type. 
    In the dialog that opens, select the SDK home directory and click OK. 

    As a result, a new SDK is added to IntelliJ IDEA and associated with the module. 
    To view or edit the SDK name and contents, click Edit. (The SDK page will open.) 
    Click OK in the Project Structure dialog.