JDK1.6到1.8的注意事项
来源:互联网 发布:电脑淘宝联盟新手教程 编辑:程序博客网 时间:2024/06/04 17:51
jdk7都终止更新了,而我们还在用jdk6.。。。 ,安全层面是一个问题,同时有更多的小伙伴早就迫不及待的想使用jdk8才支持的新特性,so,升级计划提上议程,但是升级前的功课还是要做的:
1.sun.* 包缺失问题
如有特殊需求,请下载sun-support-4jkd8.jar ,放到classpath目录
sun.*包 ,已不推荐使用,oracle会逐步进行删除,建议大家不要使用。参考如下:
http://www.oracle.com/technetwork/java/javase/8-compatibility-guide-2156366.html
http://www.oracle.com/technetwork/java/faq-sun-packages-142232.html
2.默认安全策略修改
升级后估计有些小伙伴在使用不安全算法时可能会发生错误,so,支持不安全算法还是有必要的
找到$JAVA_HOME下 jre/lib/security/java.security
将禁用的算法设置为空:jdk.certpath.disabledAlgorithms=
3.第三方jar包无法使用
1)查找组件用到了mvel,mvel为了提高效率进行了字节码优化,正好碰上jdk8死穴,所以需要升级。
<dependency>
<groupId>org.mvel</groupId>
<artifactId>mvel2</artifactId>
<version>2.2.7.Final</version>
</dependency>
2)javassist与jdk8 兼容性问题,需要升级到最新版本
<dependency>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.18.1-GA</version>
</dependency>
--#注意部署工具,不会删除旧版本,所以需要手动删除之前的版本。
4.JVM参数调整
在jdk8中,PermSize相关的参数已经不被使用:
-XX:MaxPermSize=size
Sets the maximum permanent generation space size (in bytes). This option was deprecated in JDK 8, and superseded by the -XX:MaxMetaspaceSize option.
-XX:PermSize=size
Sets the space (in bytes) allocated to the permanent generation that triggers a garbage collection if it is exceeded. This option was deprecated un JDK 8, and superseded by the -XX:MetaspaceSize option.
Java 8中再也没有PermGen了。其中的某些部分,如被intern的字符串,在Java 7中已经移到了普通堆里。其余结构在Java 8中会被移到称作“Metaspace”的本机内存区中,该区域在默认情况下会自动生长,也会被垃圾回收。它有两个标记:MetaspaceSize和MaxMetaspaceSize。
-XX:MetaspaceSize=size
Sets the size of the allocated class metadata space that will trigger a garbage collection the first time it is exceeded. This threshold for a garbage collection is increased or decreased depending on the amount of metadata used. The default size depends on the platform.
-XX:MaxMetaspaceSize=size
Sets the maximum amount of native memory that can be allocated for class metadata. By default, the size is not limited. The amount of metadata for an application depends on the application itself, other running applications, and the amount of memory available on the system.
The following example shows how to set the maximum class metadata size to 256 MB:-XX:MaxMetaspaceSize=256m
- JDK1.6到1.8的注意事项
- 记录JDK1.6升到1.8的坑
- JDK1.6_023的版本及升级注意事项
- 在Linux下安装JDK1.6的方法及注意事项
- jdk1.7到1.8,环境变量的修改
- jdk1.6 升级到1.7的方法
- 由jdk1.5升级到jdk1.6时MyEclipse里的配置项
- 关于play从jdk1.6换到jdk1.8时报错问题的解决办法
- jdk1.7升级到1.8遇到的问题
- JDK1.5到JDK1.8增加的新特性
- ConcurrentHashMap从jdk1.7到jdk1.8的变化
- ConcurrentHashMap从jdk1.7到jdk1.8的变化
- JDK1.4升级注意事项
- 系统升级修改说明:JDK1.3 升级到 JDK1.6
- 项目从jdk1.4迁移到jdk1.6
- was ejb客户端从jdk1.5到jdk1.6升级
- jdk1.4与jdk1.5及jdk1.6的区别
- jdk1.4,jdk1.5和jdk1.6的区别
- Maximum path sum I
- iOS学习之 - HTTP属性
- 《第五项修炼》读书笔记(3)
- iOS之运行时机制及方法混写method swizzling
- <a>标签中href="javascript:;"
- JDK1.6到1.8的注意事项
- [BZOJ1369] [Baltic2003]Gem
- The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar
- android各种开源框架总结(持续更新)
- Android SQLite数据库的使用
- 不需要配置在线查看Android源代码
- Android图形系统之Surface、SurfaceView、SurfaceHolder及SurfaceHolder.Callback之间的联系
- HBase源码分析之HRegion上compact流程分析(三)
- typeid用于返回指针或引用所指对象的实际类型。