84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
想在项目中使用jdk1.8的一些新特性去开发,但是编译出来的class如果在低版本的java环境中运行会出现class版本不匹配的问题。如图
jdk1.8
那么想请教下,Spring中是如何做到通过1.8编译,而只要求jdk版本大于1.6就可以的?
版本要求
spring build.gradle文件
希望大神可以解答下,目前没搞明白比较困惑
光阴似箭催人老,日月如移越少年。
You can take a lookjavac的参数,里面有两个source和target
javac
source
target
-source <版本> 提供与指定版本的源兼容性 -target <版本> 生成特定 VM 版本的类文件
The compiled class file version can be changed by setting these two parameters. For examplejavac -source 1.6 -target 1.6 Hello.java
javac -source 1.6 -target 1.6 Hello.java
To use the new features of 1.8, you can introduce third-party jar packages. Still compiled using jdk1.6.
You can take a look
javac
的参数,里面有两个source
和target
The compiled class file version can be changed by setting these two parameters.
For example
javac -source 1.6 -target 1.6 Hello.java
To use the new features of 1.8, you can introduce third-party jar packages. Still compiled using jdk1.6.