1.下载最新的Eclipse(老版本的有可能不包含springBoot插件),然后在help中打开Eclipse MarketPlace,在Spring Marketplace 中搜索SpringBoot,然后安装(安装过程比较慢)

2.点击 I Agree……,然后,点击Finish

3.安装完成后,重启eclipse

4.新增一个SpringBoot项目

5.点击next,根据提示填写相关项目信息,

6.点击next,根据实际需要选择依赖的选项,

7.点击next,然后点击finish按钮,开始创建项目,第一次加载时因为需要联网下载jar包,可能比较慢,慢慢等待即可。

我的工程创建完成后,pom.xml报错了,Missing artifact mysql:mysql-connector-java:jar:8.0.15

解决方法:将maven仓库下的mysql整个文件夹删除,然后重新下载mysql相关的jar,就可以了。

创建完成的项目解决如下:

8.启动项目

a.项目生成后会自动生成一个测试类TestSpringBootApplication.java,以Run As -> Spring Boot App方式运行,控制台出现以下界面即表示运行成功。

   

package com.example.testspringboot;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication
public class TestSpringBootApplication { public static void main(String[] args) {
SpringApplication.run(TestSpringBootApplication.class, args);
} }

b.以页面方式访问hello world,则使用@RestController注解,新建测试类,TestController,并且添加hello方法

按照a运营springBoot项目后,直接在页面访问即可:http://localhost:8080/hello

TestController.java
package com.example.testspringboot;

import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; @RestController
@SpringBootApplication
public class TestController {
@RequestMapping("/hello")
public String hello(){
return"Hello SpringBoot!";
}
}

Eclipse中创建SpringBoot项目流程,及报错解决方案的更多相关文章

  1. Eclipse中创建Maven项目失败

    Eclipse中创建Maven项目报错:Unable to create project from archetype org.apache.maven.archetypes:maven-archet ...

  2. 在Eclipse中创建Django项目

    在以前的分享中,我们是在命令行模式下创建Django项目的,那么,如何在IDE中使用Django呢? 本文将介绍如何在Eclipse中创建Django项目. 首先,新建Django项目mysite,如 ...

  3. (3)Maven快速入门_3在Eclipse中创建Maven项目打包成jar

    Eclipse中创建Maven项目 new ---> maven project  ----> next 如下 普通java项目 选择  如下 quickstart 创建项目 : 输入 G ...

  4. 【HANA系列】SAP ECLIPSE中创建ABAP项目失败原因解析

    公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[HANA系列]SAP ECLIPSE中创建AB ...

  5. 【HANA系列】SAP ECLIPSE中创建ABAP项目的步骤

    公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[HANA系列]SAP ECLIPSE中创建AB ...

  6. 新建SpringBoot项目运行页面报错Whitelabel Error Page This application has no explicit mapping for /error, so yo

    新建SpringBoot项目运行页面报错Whitelabel Error Page This application has no explicit mapping for /error, so yo ...

  7. eclipse 中离线安装activiti插件,报错“An error occurred while collecting items to be installed session context was:(...”

    eclipse 中离线安装activiti插件,报错“An error occurred while collecting items to be installed session context ...

  8. 【MAVEN】如何在Eclipse中创建MAVEN项目

    目录结构: contents structure [+] 1,Maven简介 2,Maven安装 2.1,下载Maven 2.2,配置环境变量 2.3,测试 3,Maven仓库 3.1,Maven仓库 ...

  9. 在本机eclipse中创建maven项目,查看linux中hadoop下的文件、在本机搭建hadoop环境

    注意 第一次建立maven项目时需要在联网情况下,因为他会自动下载一些东西,不然突然终止 需要手动删除断网前建立的文件 在eclipse里新建maven项目步骤 直接新建maven项目出了错      ...

随机推荐

  1. 23.Merge k Sorted Lists (Array, Queue; Sort)

    Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. 思 ...

  2. UNITY 多SCENE加载与编辑

    Unity内部场景的加载分为两步: Loading.是指从文件.内存(主要是Streamed scene AssetBundle)中加载Scene的内容,创建并读取所有相关的Game objects. ...

  3. 307. Range Sum Query - Mutable查询求和的范围(可变)

    [抄题]: Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inc ...

  4. How to use mouse to moving windows of not have title bar?

    How to use mouse to moving windows of not have title bar? #include "widget.h" #include < ...

  5. jdeveloper12.1.3的安装与卸载

    jdeveloper12.1.3的安装步骤:1>安装jdk7.0 2>在命令行中输入:cd C:\Program Files\Java\jdk1.7.0_60\bin 3>命令行安装 ...

  6. __next__和__iter__实现迭代器协议

    ---恢复内容开始--- #_*_coding:utf-8_*_ __author__ = 'Linhaifeng' class Foo: def __init__(self,x): self.x=x ...

  7. eigen安装

    https://blog.csdn.net/liuxiaoheng1992/article/details/54410148

  8. 关于简单的三层的简化(bll,dal,model)的封装这里全部都在一个文件主要在于明白意思

    using System;using System.Collections.Generic;using System.Linq;using System.Text; namespace 封装泛型CRU ...

  9. 【记录】CentOS7安装NODEBB

    NodeBB介绍: NodeBB 是一个更好的论坛平台,专门为现代网络打造.它是免费的,易于使用. NodeBB 论坛软件是基于 Node.js开发,支持 Redis 或 MongoDB 的数据库.它 ...

  10. 图形查询属性(IdentifyTask实现查询)//查询本地服务

    主页代码: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <tit ...