【SpringBoot】支持Java1.6
开发环境
- 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>
参考链接:
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的更多相关文章
- Android Studio支持Java1.8的解决方案
Java1.8新添了一些特性,比如对lambda表达式的支持,父类推断等等,这篇文章讲述了1.8的新特性,有兴趣的同学可以点进去看看.但是由于AndroidStudio并不能直接支持Java1.8,我 ...
- spring-boot支持websocket
spring-boot本身对websocket提供了很好的支持,可以直接原生支持sockjs和stomp协议.百度搜了一些中文文档,虽然也能实现websocket,但是并没有直接使用spring-bo ...
- 天啦!竟然从来没有人讲过 SpringBoot 支持配置如此平滑的迁移
SpringBoot 是原生支持配置迁移的,但是官方文档没有看到这方面描述,在源码中才看到此模块,spring-boot-properties-migrator,幸亏我没有跳过.看到这篇文章的各位,可 ...
- SpringBoot支持SpringData es
ElasticSearch CRUD 1.springboot springData es spring data 是spring对数据访问抽象.这些数据可以放入db,index,nosql等包含以下 ...
- springboot(二)配置SpringBoot支持自动装载Servlet
Servlet详解:https://blog.csdn.net/yanmiao0715/article/details/79949911 Web 技术成为当今主流的互联网 Web 应用技术之一,而 S ...
- spring-boot支持双数据源mysql+mongo
这里,首先想说的是,现在的web应用,处理的数据对象,有结构化的,也有非结构化的.同时存在.但是在spring-boot操作数据库的时候,若是在properties文件中配置数据源的信息,通过默认配置 ...
- springBoot支持PageHelp插件使用学习笔记
首先在springboot项目的maven中加入依赖(版本可能需要自己选择合适的) <dependency> <groupId>com.github.pagehelper< ...
- SpringBoot支持AJAX跨域请求
利用注解的方式解决AJAX请求跨域问题 1.编写一个支持跨域请求的 Configuration - 第一种方式 - CorsConfig.java import org.springframework ...
- springboot支持webSocket和stomp实现消息订阅通知示例
先导入支持websocket的jar包,这里用Gradle构建的项目: dependencies { compile('org.springframework.boot:spring-boot-sta ...
随机推荐
- mac上不了网
不知怎么回事勾选了socks代理导致ping的通但打不开网页软件登不了
- 利用selenium模拟登录webqq
from selenium import webdriver import selenium.webdriver.support.ui as ui import time opt = webdrive ...
- [LeetCode&Python] Problem 453. Minimum Moves to Equal Array Elements
Given a non-empty integer array of size n, find the minimum number of moves required to make all arr ...
- xdoj-1211 (尧老师要教孩子解方程) :多项式除法
想法: 1 由于所有a[i] 是不为0的整数 所以解x是整数 2 其次解是an的约数 3 分解a[n] 用多项式除法判断约数是否为整式的解 #include<cstdio> #includ ...
- 远程登录多用户同时访问Win7系统远程桌面
https://jingyan.baidu.com/article/ca00d56c384ea0e99febcf45.html 一,远程电脑上新增三个用户名 1 在远程电脑桌面,右击[计算机]图标 ...
- zabbix使用企业微信发送告警信息
用qq邮箱发送告警信息一点都不方便,看到网上说也可以使用微信发送告警信息,所以就试了一下. 首先先试着在虚拟主机上给微信发送信息. 我们需要注册企业微信,注册时有一个地方需要注意,就是注册时选择组织, ...
- day 55 jQuery 之事件 绑定等
属性选择器: [attribute] [attribute=value]// 属性等于 列入 $("input[value='male']").prop('chekced') 注意 ...
- FastAdmin Git 开发更新流程
更加简洁的流程 FastAdmin 使用 Git 更新的新用法 https://www.cnblogs.com/F4NNIU/p/9120365.html
- 20 约束 异常处理 MD5 日志
三十九, 一.类的约束 1.抛出异常 NotImplementedError 2.抽象方法 含有抽象方法的类是抽象类 抽象类中的方法全是抽象方法的是接口 抽象类不能创建对象 二.异常处理 处理完 ...
- DES加密Java实现
下面是代码的实现: package com.smt.cipher.symmetry; import java.nio.charset.Charset; import java.security.Sec ...