Eclipse Memory Analyzer - Incompatible JVM
Asked Answered
P

5

5

I have download Eclipse MAT and try to launch it on Windows.

Executing MemoryAnalyzer.exe display a popup Incompatible JVM with this message: Version 1.8.0_242 of the JVM is not suitable for this product. Version: 11 or greater is required.

As said in this doc, I have created a jre directory and copied an OpenJDK 16 which solves the issue.

But I don't find this solution very elegant. So I tried to add the -vm parameter in the MemoryAnalyzer.ini and also tried to create an eclipse.ini file as reference by the doc. It doesn't work !

Is there a way to configure the location of the JVM without copy it entirely in the mat/jre directory ?

  • NB 1: the documentation seems out of date. The MemoryAnalyzer.ini file exists whereas the doc references the eclipse.ini which is not present in the default installation.
  • NB 2: I don't want to change my JAVA_HOME just for this tool.
Prismatoid answered 2/3, 2022 at 14:54 Comment(0)
P
1

As said previously, one solution is to create a jre directory and copy a JDK in it.

Prismatoid answered 2/3, 2022 at 14:54 Comment(0)
C
6

The -vm parameter in MemoryAnalyzer.ini does work, use two lines for -vm and the path to the JVM. The documentation explaining about eclipse.ini is general Eclipse documentation; Memory Analyzer is an RCP application with its own command, so uses a different ini file. See also Problems Starting the Memory Analyzer

Cherish answered 30/3, 2022 at 9:48 Comment(3)
Using two lines for -vm and the path to the JVM doesn't work for me. Incompatible error still shows up. Two lines are -vm and "D:\Program Files\Java\jdk-20\bin". I have to run MemoryAnalyzer.exe -vm "D:\Program Files\Java\jdk-20\bin" from command line. Not sure why?Fulks
Make sure the -vm arguments are before any -vmargs lines. The -vmargs lines must come last. See wiki.eclipse.org/Eclipse.ini for general documentation for eclipse.ini files; for memory analyzer the file is called MemoryAnalyzer.iniCherish
It works. Thank you. The wiki link is helpful. By the way, the two lines have to be -vm and D:\Program Files\Java\jdk-20\bin. The second line cannot be quoted.Fulks
B
2

example of MemoryAnalyzer.ini:

-startup
plugins/org.eclipse.equinox.launcher_1.6.400.v20210924-0641.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.2.700.v20221108-1024
-vm
C:\Program Files\Java\jdk-17\bin
-vmargs
--add-exports=java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED
-Xmx5024m
-vm C:\Program Files\Java\jdk-17\binjavaw.exe
Brahms answered 28/11, 2023 at 12:16 Comment(0)
P
1

As said previously, one solution is to create a jre directory and copy a JDK in it.

Prismatoid answered 2/3, 2022 at 14:54 Comment(0)
R
1

Alternative starting from console:

"C:\Program Files\<mat x64 dir>\MemoryAnalyzer.exe" -vm "<path_to_jdk>\bin"

For example:

"MemoryAnalyzer.exe" -vm "C:\Program Files\Java\jdk-17.0.1\bin"
Rainier answered 8/5 at 11:21 Comment(0)
M
0

Solution:

  • Windows 10 Professional v22H2 (OS Build. 19045.3324).
  • Eclipse Memory Analyzer Version 1.15.0
  • Installed JAVA JDK v21 at path: C:\Program Files\Java\jre\jdk-21\bin
  • Eclipse MAT v1.15 memoryanalyzer.ini file looks like
  • Adding -vm "C:\Program Files\Java\jre\jdk-21\bin\javaw.exe" before lien -vmargs path reference.

This fixed my issue and able to run the new .hprof files.

March answered 8/8 at 3:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.