Eight, eclipse enters the JDK source code during debugging
Create a new Java project in eclipse: File --> New --> Java Project in the upper left corner
After clicking Java Project, set the project name in the pop-up box, any project name, and finally click Finish:
Find the root directory of the jdk installed on your computer, find the source code compression package src.zip in the root directory, and then decompress (the decompression location is not required):
Back to the project, import the source code in the newly unzipped src into the src directory of the newly created project: project src --> right-click import and click:
Click> in front of the first item General in the pop-up box, and then select File System in General
After double-clicking File System, click Browser in the pop-up box, find the root directory of the jdk installation, and select the src folder, as follows:
After clicking to select the folder, click the port in front of src in the pop-up box, a check mark appears, which means select all, and then click Finish below:
After clicking Finish, the source file in src is imported into the project, but an error will be reported, so you don't need to pay attention to the error in the program.
After importing the source file in the src into the project, export the project: Right-click the project --> Export
After clicking Export, click the> in front of Java in the pop-up box, and then select the first JAR file --> Next.
After clicking Next, click Browser in the pop-up box, select the export storage path (suggest to store directly in the root directory of jdk), the export result must be named rt_debug.jar, click save
After clicking Save, the storage path is confirmed, and finally click Finish. A rt_debug.jar file will be generated below the corresponding path .
Need to add the generated rt_degug.jar to eclipse: Window --> Preferences --> Click> in front of Java, and select Installed JREs in Java.
Select the jdk used, and then click the second operation Edit JRE
Add the exported rt_debug.jar to eclipse, the operations are as follows:
Find the added rt_debug.jar in the JRE system libraries, and adjust the position of rt_debug.jar through the UP on the right side. It needs to be adjusted to the front of rt.jar .