从jdk8 升级到jdk17的问题总结
目录
1. java.lang.reflect.InaccessibleObjectException:
2. java.lang.UnsatisfiedLinkError in autosys
3. java.lang.NoClassDefFoundError: Could not initialize class net.sf.jasperreports.engine.util.JRStyledTextParser
4. java.lang.UnsatisfiedLinkError: ***/lib/libfontmanager.so: libfreetype.so.6
5. his method is deprecated and marked for removal. Use the getPeerCertificates() method instead.
6. Could not initialize class com.sybase.jdbc4.jdbc.SybDriver
7. Unrecognized VM option 'UseParNewGC'
8. Failed to execute goal org.codehaus.groovy.maven:gmaven-plugin:1.0
9. Failed to execute goal org.codehaus.mojo:aspectj-maven-plugin:1.9:
10.InaccessibleObjectException while executing exec-maven-plugin
1. java.lang.reflect.InaccessibleObjectException:
异常:
java.lang.reflect.InaccessibleObjectException: Unable to make java.lang.String(char[],int,int,java.lang.Void) accessible: module java.base does not "opens java.lang" to unnamed module
解决方法:
加下面参数
--add-opens= java.base/java.lang=ALL-UNNAMED
如果是启动报错的话直接下面所有的vm的参数
export _JAVA_OPTIONS="$_JAVA_OPTIONS --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.math=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/sun.net=ALL-UNNAMED --add-opens=java.base/sun.net.www.protocol.https=ALL-UNNAMED"
如果是运行maven命令时报错,升级maven-compiler-plugin并加下面vm的参数
<plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-compiler-plugin</artifactId><version>3.8.0</version><configuration><source>${java.version}</source><target>${java.version}</target><compilerArgs><arg>--add-exports</arg><arg>java.base/java.lang=ALL-UNNAMED</arg><arg>--add-exports</arg><arg>java.base/java.io=ALL-UNNAMED</arg><arg>--add-exports</arg><arg>java.base/java.util=ALL-UNNAMED</arg><arg>--add-exports</arg><arg>java.base/java.lang.reflect=ALL-UNNAMED</arg><arg>--add-exports</arg><arg>java.base/java.math=ALL-UNNAMED</arg><arg>--add-exports</arg><arg>java.base/java.nio=ALL-UNNAMED</arg><arg>--add-exports</arg><arg>java.base/sun.security=ALL-UNNAMED</arg><arg>--add-exports</arg><arg>java.base/sun.net=ALL-UNNAMED</arg></compilerArgs></configuration>
</plugin>
2. java.lang.UnsatisfiedLinkError in autosys
异常:
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/jdk/17.0_6l64/lib/libnio.so: /opt/jdk/17.0_6l64/lib/libjava.so: version `SUNWprivate_1.1' not found (required by /opt/CA/WorkloadAutomationAE/SystemAgent/WA1_AGENT/jre/lib/amd64/libnet.so)
解决方法:
export PATH=/opt/jdk/latest/bin:$PATH
export LD_LIBRARY_PATH=/opt/jdk/latest/lib:$LD_LIBRARY_PATH
3. java.lang.NoClassDefFoundError: Could not initialize class net.sf.jasperreports.engine.util.JRStyledTextParser
解决方法:
-Djava.io.tmpdir=/yourdirectory/tmp
4. java.lang.UnsatisfiedLinkError: ***/lib/libfontmanager.so: libfreetype.so.6
异常:
SEVERE: Servlet.service() for servlet [dispatcherServlet] in context with path [/***] threw exception [Handler dispatch failed; nested exception is java.lang.UnsatisfiedLinkError: ***/lib/libfontmanager.so: libfreetype.so.6: cannot open shared object file: No such file or directory] with root cause
java.lang.UnsatisfiedLinkError: ***/lib/libfontmanager.so: libfreetype.so.6: cannot open shared object file: No such file or directory
解决方法:
yum -y install freetype&&\
yum-y install fontconfig
5. his method is deprecated and marked for removal. Use the getPeerCertificates() method instead.
异常:
java.lang.UnsupportedOperationException: This method is deprecated and marked for removal. Use the getPeerCertificates() method instead.
at java.base/javax.net.ssl.SSLSession.getPeerCertificateChain(SSLSession.java:295)
at java.base/javax.net.ssl.HandshakeCompletedEvent.getPeerCertificateChain(HandshakeCompletedEvent.java:173)
解决方法:
升级下面jar
<dependency><groupId>com.ibm.mq</groupId><artifactId>com.ibm.mq.allclient</artifactId><version>9.2.4.0</version>
</dependency>
6. Could not initialize class com.sybase.jdbc4.jdbc.SybDriver
异常:
Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.sybase.jdbc4.jdbc.SybDriver
at java.lang.Class.forName0(Native Method) ~[?:?]
at java.lang.Class.forName(Class.java:467) ~[?:?]
at java.sql.DriverManager.isDriverAllowed(DriverManager.java:558) ~[java.sql:?]
at java.sql.DriverManager.isDriverAllowed(DriverManager.java:550) ~[java.sql:?]
at java.sql.DriverManager.getDrivers(DriverManager.java:451) ~[java.sql:?]
解决方法:
没有好的解决方法。既不能升级sybDriver也不能fix , 最后只能remove了。
7. Unrecognized VM option 'UseParNewGC'
异常:
Unrecognized VM option 'UseParNewGC'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Unrecognized VM option 'UseConcMarkSweepGC'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Error: Could not find or load main class XX:+AlwaysPreTouch
Caused by: java.lang.ClassNotFoundException: XX:+AlwaysPreTouch
Unrecognized VM option 'UseCMSInitiatingOccupancyOnly'
解决方法:
删掉这些参数,因为CMS Garbage Collector不能用了。
8. Failed to execute goal org.codehaus.groovy.maven:gmaven-plugin:1.0
[ERROR] Failed to execute goal org.codehaus.groovy.maven:gmaven-plugin:1.0:execute (default-cli) on project aspen-positions-core: java.lang.reflect.InaccessibleObjectException: Unable to make java.lang.String(char[],int,int,java.lang.Void) accessible: module java.base does not "opens java.lang" to unnamed module @2e2ccf82 -> [Help 1]
解决方法:
升级gmaven-plugin.
<plugin><groupId>org.codehaus.gmavenplus</groupId><artifactId>gmavenplus-plugin</artifactId> <version>3.0.0</version>
....
</plugin>
9. Failed to execute goal org.codehaus.mojo:aspectj-maven-plugin:1.9:
[ERROR] Failed to execute goal org.codehaus.mojo:aspectj-maven-plugin:1.9:compile (default) on project aspen-positions-web: Execution default of goal org.codehaus.mojo:aspectj-maven-plugin:1.9:compile failed: Plugin org.codehaus.mojo:aspectj-maven-plugin:1.9 or one of its dependencies could not be resolved: Could not find artifact com.sun:tools:jar:17.0.5 at specified path C:\apps\jdk-17.0.5/../lib/tools.jar -> [Help 1]
解决方法:
升级aspectj-maven-plugin. 注意要把dependency全去掉
<plugin><groupId>dev.aspectj</groupId><artifactId>aspectj-maven-plugin</artifactId><version>1.13.1</version>.........</plugin>
10.InaccessibleObjectException while executing exec-maven-plugin
<plugin><groupId>org.codehaus.mojo</groupId><artifactId>exec-maven-plugin</artifactId><version>3.1.0</version> <plugin>
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @5aea386f
解决方法:
再运行maven命令之前,加入下面vm参数,英文exec-maven-plugin运行的时候不是独立的jvm process.
MAVEN_OPTS=--add-opens=java.base/java.lang=ALL-UNNAMED
相关文章:
从jdk8 升级到jdk17的问题总结
目录 1. java.lang.reflect.InaccessibleObjectException: 2. java.lang.UnsatisfiedLinkError in autosys 3. java.lang.NoClassDefFoundError: Could not initialize class net.sf.jasperreports.engine.util.JRStyledTextParser 4. java.lang.UnsatisfiedLinkError: **…...

一百七十二、Flume——Flume采集Kafka数据写入HDFS中(亲测有效、附截图)
一、目的 作为日志采集工具Flume,它在项目中最常见的就是采集Kafka中的数据然后写入HDFS或者HBase中,这里就是用flume采集Kafka的数据导入HDFS中 二、各工具版本 (一)Kafka kafka_2.13-3.0.0.tgz (二)…...

pnpm 升级
1. 在以下路径下删除pnpm包 2. 执行which pnpm,在结果目录中删除pnpm 3. sudo npm install -g pnpm 重新安装,node默认使用16...
有关使用HttpServletRequest的Cookie的设置和获取
文章目录 小结问题和解决参考 小结 介绍了如何在HttpServletRequest中对Cookie的进行设置和获取。 问题和解决 在服务器端的HttpServletRequest中对Cookie的进行设置后,客户端在接下来的请求中会携带此设置好的Cookie,所以可以在服务器端接收请求时提…...
关于 Nginx 的哪些事
关于 Nginx 的哪些事 1、Nginx 主要功能2、Nginx 的常用命令2.1、启动Nginx2.2、停止 Nginx2.3、重新加载Nginx 配置2.4、检查Nginx配置文件2.5、指定配置文件2.6、检查Nginx版本2.7、显示Nginx帮助信息 3、Nginx 配置文件 nginx.conf3.1、Nginx 配置文件(nginx.con…...

插入排序——希尔排序
1、简述: 希尔排序(Shells Sort)是插入排序的一种又称“缩小增量排序”(Diminishing Increment Sort),是直接插入排序算法的一种更高效的改进版本。希尔排序是非稳定排序算法。该方法因 D.L.Shell 于 1959 年提出而得名。 希尔排…...

C语言之初阶总结篇
目录 NO.1 NO.2 NO.3 NO.4 NO.5 NO.6 NO.7 NO.8 NO.9 NO.10 NO.11 NO.12.概念tips NO.13.求最小公倍数 NO.14.最大公因数 NO.15.输入读取字符串 NO.16.倒置字符串 今天是一些C语言题目,最近天气炎热,多喝水。 NO.1 下面程序执行后&am…...

Android签名查看
查看签名文件信息 第一种方法: 1.打开cmd,执行keytool -list -v -keystore xxx.keystore,效果如下图: 第二种方法: 1.打开cmd,执行 keytool -list -v -keystore xxxx.keystore -storepass 签名文件密码࿰…...
Educational Codeforces Round 3
目录 A. USB Flash Drives B. The Best Gift C. Load Balancing D. Gadgets for dollars and pounds A. USB Flash Drives #include<bits/stdc.h>using namespace std; const int N1e65; typedef long long ll; typedef pair<ll,ll> pll; typedef array<int…...
Docker Compose常用命令
常用命令 1.1 restart, start, stop-- 启动和停止服务 命令必须在 docker-compose.yml文件所在的目录下执行。 # 前台启动, 启动项目中的所有服务。 $. docker-compose up# 后台启动, 启动所有服务并在后台运行。 $. docker-compose up -d# 停止所有服务。 $. docker-compose …...

C++——智能指针
智能指针 文章目录 智能指针内存泄漏智能指针解决内存泄漏问题智能指针的使用及原理RAII智能指针对象的拷贝问题 C中的智能指针auto_ptrunique_ptrshared_ptrweak_ptr定制包装器C11和boost中智能指针的关系 内存泄漏 什么是内存泄漏:内存泄漏指因为疏忽或错误造成程…...

CVE-2023-3836:大华智慧园区综合管理平台任意文件上传漏洞复现
文章目录 CVE-2023-3836:大华智慧园区综合管理平台任意文件上传漏洞复现0x01 前言0x02 漏洞描述0x03 影响范围0x04 漏洞环境0x05 漏洞复现1.访问漏洞环境2.构造POC3.复现 CVE-2023-3836:大华智慧园区综合管理平台任意文件上传漏洞复现 0x01 前言 免责声…...

LAMP搭建WordPress
L linux A apache hhtpd M mysql/maridb P PHP1、 安装php yum -y install php php-fpm php-server php-mysql1.1、 启动php-fpm并自启 systemctl enable php-fpm --now[rootecs-1cee ~]# systemctl status php-fpm ● php-fpm.service - The PHP FastCGI Process ManagerLoa…...

【数学建模竞赛】预测类赛题常用算法解析
解析常见的预测类算法 灰色预测模型 灰色预测模型是一种利用少量的、不完全的信息,建立数学模型并进行预测的方法。该方法通过对系统行为特征的发展变化规律进行估计预测,同时也可以对行为特征的异常情况发生的时刻进行估计计算,并研究特定…...

OFDM 系统在 AWGN 信道下对不同载波频率偏移 (CFO) 的 BER 灵敏度研究(Matlab代码实现)
💥💥💞💞欢迎来到本博客❤️❤️💥💥 🏆博主优势:🌞🌞🌞博客内容尽量做到思维缜密,逻辑清晰,为了方便读者。 ⛳️座右铭&a…...
go基础07-了解map实现原理并高效使用
对于C程序员出身的Gopher来说,map类型是和切片、interface一样能让他们感受到Go语言先进性的重要语法元素。map类型也是Go语言中最常用的数据类型之一。 go 中 map 怎么表现? 一些有关Go语言的中文教程或译本将map称为字典或哈希表,但在这里…...
SpringMVC进阶:常用注解、参数传递和请求响应以及页面跳转
目录 一、常用注解 1.1.RequestMapping 1.2.RequestParam 1.3.ModelAttribute 1.4.SessionAttributes 1.5.RequestBody 1.6.RequestHeader 1.7.PathVariable 1.8.CookieValue 二、参数传递 2.1.基础类型String 2.2.复杂类型 2.3.RequestParam 2.4.PathVariable 2…...
nacos - centos7.x环境单机与集群快速部署
参考官网:https://nacos.io/zh-cn/docs/what-is-nacos.html 官方集群部署手册:https://nacos.io/zh-cn/docs/cluster-mode-quick-start.html 【单机部署】 1.下载 & 解压到安装目录 下载:wget -c https://github.com/alibaba/nacos/releases/download/2.1.2/nacos-ser…...

文心一言初体验,和ChatGPT语言理解能力比较
文章目录 第一个考验,语义理解第二个考验,历史问题的回答推荐阅读 百度旗下AI大模型文心一言宣布向全社会全面开放,所有用户都可以体验这款AI大模型了。要比较这两个语言模型,我们先设计好题目。 第一个考验,语义理解 题目1&…...

浏览器进程,性能指标,性能优化
目录 浏览器进程:多进程 主进程:显示、交互,增删进程 UI进程:控制地址栏、书签、前进后退 存储进程:cookie,webstorage,indexDB 渲染进程:每个标签页或窗口都有一个独立的渲染进…...

地震勘探——干扰波识别、井中地震时距曲线特点
目录 干扰波识别反射波地震勘探的干扰波 井中地震时距曲线特点 干扰波识别 有效波:可以用来解决所提出的地质任务的波;干扰波:所有妨碍辨认、追踪有效波的其他波。 地震勘探中,有效波和干扰波是相对的。例如,在反射波…...

7.4.分块查找
一.分块查找的算法思想: 1.实例: 以上述图片的顺序表为例, 该顺序表的数据元素从整体来看是乱序的,但如果把这些数据元素分成一块一块的小区间, 第一个区间[0,1]索引上的数据元素都是小于等于10的, 第二…...

通过Wrangler CLI在worker中创建数据库和表
官方使用文档:Getting started Cloudflare D1 docs 创建数据库 在命令行中执行完成之后,会在本地和远程创建数据库: npx wranglerlatest d1 create prod-d1-tutorial 在cf中就可以看到数据库: 现在,您的Cloudfla…...
java 实现excel文件转pdf | 无水印 | 无限制
文章目录 目录 文章目录 前言 1.项目远程仓库配置 2.pom文件引入相关依赖 3.代码破解 二、Excel转PDF 1.代码实现 2.Aspose.License.xml 授权文件 总结 前言 java处理excel转pdf一直没找到什么好用的免费jar包工具,自己手写的难度,恐怕高级程序员花费一年的事件,也…...

Swift 协议扩展精进之路:解决 CoreData 托管实体子类的类型不匹配问题(下)
概述 在 Swift 开发语言中,各位秃头小码农们可以充分利用语法本身所带来的便利去劈荆斩棘。我们还可以恣意利用泛型、协议关联类型和协议扩展来进一步简化和优化我们复杂的代码需求。 不过,在涉及到多个子类派生于基类进行多态模拟的场景下,…...

从深圳崛起的“机器之眼”:赴港乐动机器人的万亿赛道赶考路
进入2025年以来,尽管围绕人形机器人、具身智能等机器人赛道的质疑声不断,但全球市场热度依然高涨,入局者持续增加。 以国内市场为例,天眼查专业版数据显示,截至5月底,我国现存在业、存续状态的机器人相关企…...
Objective-C常用命名规范总结
【OC】常用命名规范总结 文章目录 【OC】常用命名规范总结1.类名(Class Name)2.协议名(Protocol Name)3.方法名(Method Name)4.属性名(Property Name)5.局部变量/实例变量(Local / Instance Variables&…...
五年级数学知识边界总结思考-下册
目录 一、背景二、过程1.观察物体小学五年级下册“观察物体”知识点详解:由来、作用与意义**一、知识点核心内容****二、知识点的由来:从生活实践到数学抽象****三、知识的作用:解决实际问题的工具****四、学习的意义:培养核心素养…...

Cloudflare 从 Nginx 到 Pingora:性能、效率与安全的全面升级
在互联网的快速发展中,高性能、高效率和高安全性的网络服务成为了各大互联网基础设施提供商的核心追求。Cloudflare 作为全球领先的互联网安全和基础设施公司,近期做出了一个重大技术决策:弃用长期使用的 Nginx,转而采用其内部开发…...

网络编程(UDP编程)
思维导图 UDP基础编程(单播) 1.流程图 服务器:短信的接收方 创建套接字 (socket)-----------------------------------------》有手机指定网络信息-----------------------------------------------》有号码绑定套接字 (bind)--------------…...