sun.jvm.hotspot.runtime.VMVersionMismatchException: Supported versions are 25.221-b11. Target VM

简介: 今天在查看 JVM 堆内存具体使用情况的时候,执行 jmap 命令发现如下的报错信息,报错说的是虚拟机版本不匹配,感觉很奇怪因为我刚在另外一台机器上执行了这个命令,换了一台机器就执行报错,初步判断是机器环境的问题,最后对比了两个机器的 JDK 环境,发现报错的这台机器上有两个不同版本的 JDK 所以推测跟多个版本有关系.

今天在查看 JVM 堆内存具体使用情况的时候,执行 jmap 命令发现如下的报错信息,报错说的是虚拟机版本不匹配,感觉很奇怪因为我刚在另外一台机器上执行了这个命令,换了一台机器就执行报错,初步判断是机器环境的问题,最后对比了两个机器的 JDK 环境,发现报错的这台机器上有两个不同版本的 JDK 所以推测跟多个版本有关系.


Error attaching to process: sun.jvm.hotspot.runtime.VMVersionMismatchException: Supported versions are 25.221-b11. Target VM is 25.111-b14
sun.jvm.hotspot.debugger.DebuggerException: sun.jvm.hotspot.runtime.VMVersionMismatchException: Supported versions are 25.221-b11. Target VM is 25.111-b14
  at sun.jvm.hotspot.HotSpotAgent.setupVM(HotSpotAgent.java:435)
  at sun.jvm.hotspot.HotSpotAgent.go(HotSpotAgent.java:305)
  at sun.jvm.hotspot.HotSpotAgent.attach(HotSpotAgent.java:140)
  at sun.jvm.hotspot.tools.Tool.start(Tool.java:185)
  at sun.jvm.hotspot.tools.Tool.execute(Tool.java:118)
  at sun.jvm.hotspot.tools.HeapSummary.main(HeapSummary.java:49)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:498)
  at sun.tools.jmap.JMap.runTool(JMap.java:201)
  at sun.tools.jmap.JMap.main(JMap.java:130)
Caused by: sun.jvm.hotspot.runtime.VMVersionMismatchException: Supported versions are 25.221-b11. Target VM is 25.111-b14
  at sun.jvm.hotspot.runtime.VM.checkVMVersion(VM.java:227)
  at sun.jvm.hotspot.runtime.VM.<init>(VM.java:294)
  at sun.jvm.hotspot.runtime.VM.initialize(VM.java:370)
  at sun.jvm.hotspot.HotSpotAgent.setupVM(HotSpotAgent.java:431)
  ... 11 more


解决办法有两个,最简单直接的就是删除其中一个 JDK 只保留一个即可,另外一种方法是执行命令的时候指定 JDK 的绝对路径,这样也可以解决.


/home/jason/bigdata/jdk/jdk1.8.0_111/bin/jmap -heap 23639
[root@storm1 jdk]# /home/jason/bigdata/jdk/jdk1.8.0_111/bin/jmap -heap 23639
Attaching to process ID 23639, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 25.111-b14
using parallel threads in the new generation.
using thread-local object allocation.
Concurrent Mark-Sweep GC
Heap Configuration:
   MinHeapFreeRatio         = 40
   MaxHeapFreeRatio         = 70
   MaxHeapSize              = 161480704 (154.0MB)
   NewSize                  = 53084160 (50.625MB)
   MaxNewSize               = 53084160 (50.625MB)
   OldSize                  = 108396544 (103.375MB)
   NewRatio                 = 2
   SurvivorRatio            = 8
   MetaspaceSize            = 21807104 (20.796875MB)
   CompressedClassSpaceSize = 1073741824 (1024.0MB)
   MaxMetaspaceSize         = 268435456 (256.0MB)
   G1HeapRegionSize         = 0 (0.0MB)
Heap Usage:
New Generation (Eden + 1 Survivor Space):
   capacity = 47775744 (45.5625MB)
   used     = 41301888 (39.3885498046875MB)
   free     = 6473856 (6.1739501953125MB)
   86.44949202674897% used
Eden Space:
   capacity = 42467328 (40.5MB)
   used     = 41134400 (39.22882080078125MB)
   free     = 1332928 (1.27117919921875MB)
   96.86128592785494% used
From Space:
   capacity = 5308416 (5.0625MB)
   used     = 167488 (0.15972900390625MB)
   free     = 5140928 (4.90277099609375MB)
   3.1551408179012346% used
To Space:
   capacity = 5308416 (5.0625MB)
   used     = 0 (0.0MB)
   free     = 5308416 (5.0625MB)
   0.0% used
concurrent mark-sweep generation:
   capacity = 108396544 (103.375MB)
   used     = 29516576 (28.149200439453125MB)
   free     = 78879968 (75.22579956054688MB)
   27.230181803582227% used
18288 interned Strings occupying 1882760 bytes.
相关文章
|
7月前
|
存储 SQL 算法
jvm性能调优 - 11J线上VM调优案例分享
jvm性能调优 - 11J线上VM调优案例分享
187 0
|
7月前
|
Java Android开发 Kotlin
@JvmDefault is only supported since JVM target 1.8. Recompile with '-jvm-target 1.8’
@JvmDefault is only supported since JVM target 1.8. Recompile with '-jvm-target 1.8’
46 5
|
7月前
|
Java
Springboot项目启动失败: (JVM running for 2.723) 与目标 VM 断开连接, 地址为: ‘‘127.0.0.1:23604‘,传输: ‘套接字‘‘
Springboot项目启动失败: (JVM running for 2.723) 与目标 VM 断开连接, 地址为: ‘‘127.0.0.1:23604‘,传输: ‘套接字‘‘
419 0
|
7月前
|
监控 数据可视化 Java
VisualVM【实践 02】远程JVM监控的JMX配置及No supported for this JVM问题处理(Jstatd报错踩坑不计其数)
VisualVM【实践 02】远程JVM监控的JMX配置及No supported for this JVM问题处理(Jstatd报错踩坑不计其数)
431 0
|
Oracle Java 关系型数据库
深入理解JVM系列教程(01) - HotSpot VM
深入理解JVM系列教程(01) - HotSpot VM
279 0
|
Java Unix Linux
The JVM Tool Interface (JVM TI): How VM Agents Work
The JVM Tool Interface (JVM TI): How VM Agents Work
185 0
|
Oracle Java 关系型数据库
JVM详解之:HotSpot VM中的Intrinsic methods
JVM详解之:HotSpot VM中的Intrinsic methods
JVM详解之:HotSpot VM中的Intrinsic methods
|
Java
JVisualVM之GC插件+错误"not supported for this jvm"+命令jstatd
插件安装 tools->plugin->Available Plugin 会有值得安装的插件,如:VisualGC 插件列表:https://visualvm.
2392 0
|
28天前
|
缓存 Prometheus 监控
Elasticsearch集群JVM调优设置合适的堆内存大小
Elasticsearch集群JVM调优设置合适的堆内存大小
226 1