开发环境

  • 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. [LeetCode&Python] Problem 705. Design HashSet

    Design a HashSet without using any built-in hash table libraries. To be specific, your design should ...

  2. MyEclipse 优化:之占用CPU过高100%

    原因是  jsp文件代码有4000行左右,MyEclipse打开jsp的时候会越来越慢.CPU占用会越来越高,因此,需要用别的编辑器打开jsp文件,不用在MyEclipse中编辑jsp文件. 我用的是 ...

  3. Codeforces 1005D:Polycarp and Div 3

    题目链接:http://codeforces.com/problemset/problem/1005/D 题意 给出个字符串(全是数字),把这个字符串换分成一些子串,最多能划分多少个能够被3整除的子串 ...

  4. PTA——猜数字游戏

    PTA 7-24 猜数字游戏 #include <stdio.h> int main() { int num, times; scanf("%d %d", &n ...

  5. web项目【3】

    前端代码: <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.a ...

  6. Go Example--工作池

    package main import ( "fmt" "time" ) func main() { jobs :=make(chan int,100) res ...

  7. 写一个简单脚本检测mysql主从是否正常

    这个脚本是在从服务器上执行的 [root@bogon ~]# cat a.sh #!/bin/bash #下面这行目的在于检测mysql端口是否开启,如果没有开启,那说明mysql服务都没有开启,直接 ...

  8. MySQL Network--Localhost与127.0.0.1的差异

    localhost为本地服务器,而127.0.01为本机地址.在使用localhost时不经过网卡传输,不受网络防火墙和网卡相关的限制,访问localhost不会被解析成ip地址,不会占用网卡和网络资 ...

  9. kettle的系列教程

    kettle--window开发环境和linux运行环境的迁移 kettle的输入输出组件和脚本组件 kettle--变量的使用 kettle的资源库 kettle的job kettle的hello ...

  10. C# string 转 bool

    bool _b = Convert.ToBoolean("False"); "_b => false" // // 摘要: //     将逻辑值的指定字 ...