开发环境

  • Java 1.6;

需要修改的配置

指定java和tomcat版本

<!-- TO Support JDK 1.6 start -->
<java.version>1.6</java.version>
<tomcat.version>7.0.59</tomcat.version>
<!-- TO Support JDK 1.6 end --> <!-- TO Support JDK 1.6 start -->
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-juli</artifactId>
<version>${tomcat.version}</version>
</dependency>
<!-- TO Support JDK 1.6 end --> <configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>

完整的 pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <groupId>com.sssppp</groupId>
<artifactId>SpringBoot</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging> <name>SpringBoot</name>
<description>Demo project for Spring Boot</description> <parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.3.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <!-- TO Support JDK 1.6 start -->
<java.version>1.6</java.version>
<tomcat.version>7.0.59</tomcat.version>
<!-- TO Support JDK 1.6 end -->
</properties> <dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency> <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency> <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency> <!-- TO Support JDK 1.6 start -->
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-juli</artifactId>
<version>${tomcat.version}</version>
</dependency>
<!-- TO Support JDK 1.6 end -->
</dependencies> <!-- Package as an executable jar -->
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build> </project>

其他说明

创建一个可运行的Jar

To create an executable jar we need to add the spring-boot-maven-plugin to our pom.xml

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

参考链接:

How to use Java 6

Both Tomcat 7 and Jetty 8 are Java 6 compatible

Use Tomcat 7.x or 8.0 with Maven

If you are using the starters and parent you can change the Tomcat version property and additionally import tomcat-juli. E.g. for a simple webapp or service:

<properties>
<tomcat.version>7.0.59</tomcat.version>
</properties>
<dependencies>
...
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-juli</artifactId>
<version>${tomcat.version}</version>
</dependency>
...
</dependencies>

【SpringBoot】支持Java1.6的更多相关文章

  1. Android Studio支持Java1.8的解决方案

    Java1.8新添了一些特性,比如对lambda表达式的支持,父类推断等等,这篇文章讲述了1.8的新特性,有兴趣的同学可以点进去看看.但是由于AndroidStudio并不能直接支持Java1.8,我 ...

  2. spring-boot支持websocket

    spring-boot本身对websocket提供了很好的支持,可以直接原生支持sockjs和stomp协议.百度搜了一些中文文档,虽然也能实现websocket,但是并没有直接使用spring-bo ...

  3. 天啦!竟然从来没有人讲过 SpringBoot 支持配置如此平滑的迁移

    SpringBoot 是原生支持配置迁移的,但是官方文档没有看到这方面描述,在源码中才看到此模块,spring-boot-properties-migrator,幸亏我没有跳过.看到这篇文章的各位,可 ...

  4. SpringBoot支持SpringData es

    ElasticSearch CRUD 1.springboot springData es spring data 是spring对数据访问抽象.这些数据可以放入db,index,nosql等包含以下 ...

  5. springboot(二)配置SpringBoot支持自动装载Servlet

    Servlet详解:https://blog.csdn.net/yanmiao0715/article/details/79949911 Web 技术成为当今主流的互联网 Web 应用技术之一,而 S ...

  6. spring-boot支持双数据源mysql+mongo

    这里,首先想说的是,现在的web应用,处理的数据对象,有结构化的,也有非结构化的.同时存在.但是在spring-boot操作数据库的时候,若是在properties文件中配置数据源的信息,通过默认配置 ...

  7. springBoot支持PageHelp插件使用学习笔记

    首先在springboot项目的maven中加入依赖(版本可能需要自己选择合适的) <dependency> <groupId>com.github.pagehelper< ...

  8. SpringBoot支持AJAX跨域请求

    利用注解的方式解决AJAX请求跨域问题 1.编写一个支持跨域请求的 Configuration - 第一种方式 - CorsConfig.java import org.springframework ...

  9. springboot支持webSocket和stomp实现消息订阅通知示例

    先导入支持websocket的jar包,这里用Gradle构建的项目: dependencies { compile('org.springframework.boot:spring-boot-sta ...

随机推荐

  1. Nginx环境搭建准备

    前提: 1.确认系统网络 2.确认yum可用 3.确认关闭iptables规则 4.确认停用selinux 1.cd /opt mkdir app download logs work backup ...

  2. 牛客国庆集训派对Day4 I-连通块计数(思维,组合数学)

    链接:https://www.nowcoder.com/acm/contest/204/I 来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 1048576K,其他语言20 ...

  3. NetCore平台下使用RPC框架Hprose

    NetCore下使用RPC框架Hprose https://www.jianshu.com/p/c903fca44d5d Hprose是国内非常优秀的RPC框架,和其它RPC框架比较起来,其它框架一般 ...

  4. Blender模拟全局照明的简单方法

    https://en.wikibooks.org/wiki/Blender_3D:_Noob_to_Pro/Faked_Gi_with_Blender_internal模拟全局照明最简单的方法是在我们 ...

  5. SVN三种合并类型

    https://blog.csdn.net/zht666/article/details/36178117 转自:http://wenku.baidu.com/link?url=pnALYESJnX0 ...

  6. SQL将时间格式化为year-month-day

    SQL将输出年月日格式化为:2017-12-3-28 CONVERT(varchar(100),RunDate, 23) AS RunDate,

  7. python基础(三)——类的研究

    class Employee: //定义类 以冒号结束 '所有员工的基类' //帮助信息 empCount = 0 def __init__(self, name, salary): //调用时初始化 ...

  8. Nginx——debug的使用

    个人理解,debug的用处在于可以更进一步地了解页面访问出现问题的原因 nginx的debug的功能需要在编译安装时使用–with-debug选项 ./configure --prefix=/usr/ ...

  9. Modern Data Lake with Minio : Part 2

    转自: https://blog.minio.io/modern-data-lake-with-minio-part-2-f24fb5f82424 In the first part of this ...

  10. 项目构建之maven篇:5.仓库及nexus创建私服-2

    下载安装 下载地址 改动默认端口: home\conf\nexus.properties # Sonatype Nexus # ============== # This is the most ba ...