Hands with you to build Java source code with the idea (JDK source code) to read debugging environment

EDITORIAL: OS win10, jdk1.8, idea 2019.1
need to install their own jdk

1. Locate the jdk installation location on your computer

Jdk installation position of each person is different, find themselves in a position to install jdk.
When installing jdk jdk there are actually comes with source code, no longer need the Internet to download the source code.
The figure is src.zip source.
jdk installation location

2. Create a project idea

  • It recommends creating a separate section for storing the project
    welcome page New Projector File →New →Project
    1. Create a project
  • Select the Create command line project Select an item
  • Fill in the project basic information and click Finish to build the project
    finish

Jdk source be imported

  • Open the project location
    , right-click the src folder → Click Show in Explorer Open File Explorerturn on
  • The copy in advance to find the source code to the project
    copy
  • Extract the source code (src.zip) to the src directory
    Click on
    decompress after completing src.zip delete (only the deleted items folder src.zip)

If your operating correctly, then you look at your project, it must be like this
Done correctly
If you were to this point, Congratulations, you've successfully jdk source code into your project up.

At this point you if you try to run the main method, you will find that you can not run, the following error message appears.
Error Messages
At this time, do not panic, follow me step by step operation, to ensure that solve your problem

Configuration part of the idea to protect your project can run properly

  • First mistake: due to insufficient memory, we need to turn up the build process heap size
    1. Open your settingsCtrl + Alt + S or click on File-Setting
    2. ClickBuild,Execution,Deployment -Compiler
    3. The value of the Build process heap size (Mbytes) was changed to 1700
    at this time the first error is solved.
    Here Insert Picture Description
  • Second mistake: the graphical interface gtk folder, does not need, it can be deleted directly
    after the emergence of pop Click to delete
    delete
  • The third mistake: lack jar package jdk run references
  1. Click onProject Structure…
  2. Click onLibraries
  3. Click on +
  4. After selecting Java foundOwnlib file on your computer jdk installation directory folder
  5. After clicking ok, appear pop Click ok, click ok page last Project Structure

Configuration
2
3

Test items

At this point you look at your projects, has no problem, you can run normally, but need the last step, you need to configure the settings so that you can enter debug mode source
1. Open your settingsCtrl + Alt + S or click on File-Setting
2. ClickBuild,Execution,Deployment
3. ClickDebugger
4. ClickStepping
5. PlaceDo not step into the classesUncheck or only java. * Uncheck
Completion

At this point you run your main method, you can use Map to be a test.
The first project will be to build more slowly, please be patient.
After the run is complete
Here Insert Picture Description
default selection is the contents of the system in Java, it is not editable. You can click on your project name to switch, switch to the project can add your own comment information easy to understand.
Here Insert Picture Description

Above it is to use the entire contents idea to build JDK source code debugging environment.
If you have any questions please leave a message in the comment section below

Released six original articles · won praise 6 · views 2466

Guess you like

Origin blog.csdn.net/qq_26020387/article/details/105126951