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.
2. Create a project idea
- It recommends creating a separate section for storing the project
welcome page New Projector File →New →Project
- Select the Create command line project
- Fill in the project basic information and click Finish to build the project
Jdk source be imported
- Open the project location
, right-click the src folder → Click Show in Explorer Open File Explorer - The copy in advance to find the source code to the project
- Extract the source code (src.zip) to the src directory
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
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.
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.
- Second mistake: the graphical interface gtk folder, does not need, it can be deleted directly
after the emergence of pop Click to delete
- The third mistake: lack jar package jdk run references
- Click onProject Structure…
- Click onLibraries
- Click on +
- After selecting Java foundOwnlib file on your computer jdk installation directory folder
- After clicking ok, appear pop Click ok, click ok page last Project Structure
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
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
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.
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