1. Download maven
Maven is a management tool for java project development, similar to MakeFile in Linux, you need to use Maven to automatically download dependencies when creating SpringBoot, if you don't have maven, it will be red.
Install and configure maven tutorial
Automatically configure maven when creating a new project
pom.xml
After the installation is complete, you can add the following code in the project , and try to download the jar package:
<dependencies>
<dependency>
<groupId>net.schmizz</groupId>
<artifactId>sshj</artifactId>
<version>0.10.0</version>
</dependency>
<dependency>
<groupId>com.redislabs</groupId>
<artifactId>spark-redis</artifactId>
<version>2.4.0</version>
</dependency>
</dependencies>
After importing the code, remember to click refresh or download on the right maven
sidebar.
After installation, in order to speed up the download, you may also need to make the following configurations:
- Enter the following
setting->maven->importing
code inVM选项
-DarchetypeCatalog=internal -Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true
setting->maven
Change the configuration file and Mavenhome path
to local in
. If you want to use maven to import more jar packages, you can find them in the central warehouse .- If you find an error when running the project, you can try to add it to the column
File ->Settings ->Build, Execution, Deployment ->Compiler
inbuild process VM options
-Djdk.lang.Process.launchMechanism=vfork
2. Use the module that comes with Intellij IDEA to create a new SpringBoot project
Only the enterprise version of Intellij IDEA can use SpringBoot
SpringBoot Tutorial Extreme Edition
If the download fails during creation, you can try to replace the source with the following dependency if https://start.aliyun.com/
it appears at runtimeorg.junit.jupiter.api不存在
pom.xml
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>RELEASE</version>
<scope>test</scope>
</dependency>
Or take another blogger's approach
Solution to running error
If it cannot run according to the above reference materials, then there is a high probability that it is a problem with the JDK version, as long as the JDK is replaced, JDK8/JDK1.8
it can run successfully
- How to replace JDK
- Click on Intellij IDEA's
File->Project Structure-> Project->SDK->选择下载一个JDK1.8/JDK8
- After downloading, add the bin folder in the JDK file to the environment variable
- Reconfigure the JDK option of the project according to the relevant methods on the Internet
- You can also directly use Intellij IDEA to create a new SpringBoot project (version selection JDK1.8, Java8), and then copy the source code into it. I personally recommend this method, because it is fast and simple
- Click on Intellij IDEA's
3. Successfully run the screenshot
gitee warehouse: https://gitee.com/liang-jiajun2/hello-spring-boot.git