Pre-conditions:
1. Install the JDK correctly and configure the Java_home, PATH. (I'm installing jdk1.8 here.)
2. Install eclipse properly.
1. First download the spring source https://github.com/spring-projects/spring-framework/releases. Because my JDK version is 1.8, so the version i downloaded here is 4.3.2.
Unzip to the local directory when the download is complete.
2. The compilation of spring source code needs Gradle support, so we need to download Gradle gradle official website. https://gradle.org/. If you can't open it, you can go to my web drive. Download: http://pan.baidu.com/s/1kVGu8yr
Once the download is complete, you will only need to unzip to the local directory, but remember to configure the environment variable gradle_home and path at this time. When configured correctly, the cmd input: Gradle-v can correctly display the Gradle version.
3. Enter the spring source root directory, open a command window, enter the Import-into-eclipse.bat run script, start compiling the spring source code and generate the. classpath,. Project files that can be imported into eclipse.
In the process of compiling is likely to appear errors, this time need to be based on specific error information Baidu to solve. Here is a need to pay attention to the place is: the source code with the path of the Build.gradle file is generally the following words:
Compilejava {
Sourcecompatibility = 1.6
Targetcompatibility = 1.6
}
Compiletestjava {
sourcecompatibility = 1.8
targetcompatibility = 1.8
Options.compilerargs + = "-parameters"
}
This is to specify that the source code is compiled using the jdk1.6, while the test is compiled using jdk1.8. This is where you should install jdk1.8.
4. All the way to the completion of the compilation can be imported in Eclipse, remember to check the eclipse in the list of all the projects below the project options, otherwise the import is a big spring project instead of separate projects.
How to import the spring source into eclipse