问题描述:

idea进行springboot开发时,进行日志输出模式修改,之前没有对日志的级别进行设置,启动的时候也没有发现有什么问题。当把日志级别调整到debug时,启动springboot项目问题出现了,我当时用的jdk是1.8

Class not found so assuming code is running on a pre-Java 9 JVM

翻译:

找不到类,所以假设代码运行在java 9之前的jvm上

完整的异常信息:

2020-06-21 17:44:19.102 DEBUG 5524 --- [  restartedMain] o.apache.tomcat.util.compat.Jre9Compat   : Class not found so assuming code is running on a pre-Java 9 JVMjava.lang.ClassNotFoundException: java.lang.reflect.InaccessibleObjectExceptionat java.net.URLClassLoader.findClass(URLClassLoader.java:382) ~[na:1.8.0_241]at java.lang.ClassLoader.loadClass(ClassLoader.java:418) ~[na:1.8.0_241]at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355) ~[na:1.8.0_241]at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ~[na:1.8.0_241]at java.lang.Class.forName0(Native Method) ~[na:1.8.0_241]at java.lang.Class.forName(Class.java:264) ~[na:1.8.0_241]at org.apache.tomcat.util.compat.Jre9Compat.<clinit>(Jre9Compat.java:81) ~[tomcat-embed-core-9.0.36.jar:9.0.36]at org.apache.tomcat.util.compat.JreCompat.<clinit>(JreCompat.java:55) [tomcat-embed-core-9.0.36.jar:9.0.36]at org.apache.catalina.startup.Tomcat.<clinit>(Tomcat.java:1276) [tomcat-embed-core-9.0.36.jar:9.0.36]at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getWebServer(TomcatServletWebServerFactory.java:177) [spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:178) [spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:158) [spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:545) [spring-context-5.2.7.RELEASE.jar:5.2.7.RELEASE]at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143) [spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758) [spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750) [spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237) [spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) [spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]at com.lej.gmall.user.GmallUserApplication.main(GmallUserApplication.java:12) [classes/:na]at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_241]at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_241]at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_241]at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_241]at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) [spring-boot-devtools-2.3.1.RELEASE.jar:2.3.1.RELEASE]

解决方法:

jdk更换更高的版本,我当时为了验证自己的猜测,在官网上下载了jdk11,然后重新设置项目的jdk,问题没有再出现,但是又出现了一个其他问题:org.apache.tomcat.jni.LibraryNotFoundError: Can't load library: C:\Users\IdeaProjects\springbootstudy\bin\tcnative-1.dll, Can't load library: 这个问题就是springboot自带的tomcat中应该没有tcnative-1.dll,于是才出现了这个问题,解决方法:从tomcat(tcnative-1.dll这个是分32位或者64位的,根据系统进行下载相关文件) bin目录中找该文件然后放到自己系统Windows\system32\目录下,然后重新启动程序,问题没再出现。

Class not found so assuming code is running on a pre-Java 9 JVM相关推荐

  1. java tm 插件_VS Code 中有哪些好用的 Java 插件?

    说到写 Java,想必做 Java 开发的童鞋,蛮多都是会用 IntelliJ, Eclipse 或是 Netbeans.许多童鞋也许会问,VS Code 也能写 Java? 是的,没错,VS Cod ...

  2. java code large_Java中的“代码太大”编译错误(“Code too large” compilation error in Java)...

    Java中的"代码太大"编译错误("Code too large" compilation error in Java) Java中的代码是否有最大大小? 我写 ...

  3. Checking if your code is running on 64-bit PHP

    Check the PHP_INT_SIZE constant. It'll vary based on the size of the register (i.e. 32-bit vs 64-bit ...

  4. vscode写java没有提示_VS Code报错Language Support for Java(TM)插件显示需要JDK11 写java代码没有提示...

    鉴于IDEA的打开速度(电脑的垃圾),平常刷LeetCode都是在VSCode上,结果这几天老是打开给我报错 Java 11 or more recent is required to run. Pl ...

  5. Java HotSpot VM 命令行参数【官方版】

    2019独角兽企业重金招聘Python工程师标准>>> Java HotSpot VM Command-Line Options Command-line options that ...

  6. java检查版本_如何检查Java版本

    java检查版本 Sometimes we need to check the Java version while executing a java program. We could be dev ...

  7. 如何使用Visual Studio Code作为Git的默认编辑器

    本文翻译自:How to use Visual Studio Code as Default Editor for Git When using git at the command line, I ...

  8. Characterizing, exploiting, and detecting DMA code injection vulnerabilities,Eurosys2021

    Characterizing, exploiting, and detecting DMA code injection vulnerabilities in the presence of an I ...

  9. 整理:使用 Visual Studio Code (vscode) 编写、运行、 调试 Java 应用程序

    作为一个喜欢折腾的人,最近抽空折腾一下VScode怎么写java程序.不断更新中.. 附一个原来写的C++的:这两个链接,第二个稍微简单一些 1)Visual Studio Code配置C.C++环境 ...

  10. 作为JavaScript开发人员,这些必备的VS Code插件你都用过吗

    本文翻译自:https://www.sitepoint.com/vs-code-extensions-java-developers/ 转载请注明出处:葡萄城官网,葡萄城为开发者提供专业的开发工具.解 ...

最新文章

  1. go 用的不多的命令
  2. HealthKit开发教程之HealthKit的辅助数据
  3. jQuery Mobile 图标无法显示
  4. 关于汇编跟C/C++已经java的内存理解
  5. CPU-bound(计算密集型) 和I/O bound(I/O密集型)
  6. linux 常用操作指令(随时更新)
  7. vs2019新建android生成app,VS2017 VS2019创建离线安装包
  8. android mtk 按键,Android 4.0 虚拟按键、手机模式、平板模式(转)
  9. markdown与latex:如何写出像数学书里的大于等于\geqslant和小于等于\leqslant
  10. DarkAngels勒索病毒分析
  11. java sql小区物业管理系统_小区物业管理系统javasql.doc
  12. FPGA UART串口协议
  13. [推荐系统]互联网推荐系统比较研究
  14. 安卓模拟器最优选择+抖音检测全绕过简述
  15. mac游戏排行榜,mac好玩的游戏推荐 (一)
  16. 有三顶红帽子和两顶蓝帽子逻辑推理
  17. python获取当前进程pid_Python获取系统所有进程PID及进程名称的方法示例
  18. window系统杀死进程方法
  19. 《中国集成电路产业人才白皮书(2017-2018)》在京发布
  20. clickhouse-backup 备份恢复测试

热门文章

  1. 数据驱动背景下的设备故障预测及诊断方法
  2. Linux下基础命令(二)
  3. 推荐一个不错的国外html5模板网站
  4. (C语言)不变初心数 (15 分)---pta
  5. 三国志战略版360区S4服务器合并信息,三国志战略版S3赛季哪些大区合并
  6. InnoDB存储引擎介绍-(6) 二. Innodb Antelope文件格式
  7. 用Markdown来创建待办事项
  8. ping的通百度但是浏览器打不开的解决方法
  9. 达梦DW+DSC环境mal压缩测试
  10. 前端架构师的YY定义