3

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.
Nicolas Dupouy
  • 450
  • 1
  • 7
  • 11

2 Answers2

4

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

user13762112
  • 401
  • 3
  • 7
  • 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? – niaomingjian Apr 26 '23 at 01:57
  • 2
    Make sure the -vm arguments are before any -vmargs lines. The -vmargs lines must come last. See https://wiki.eclipse.org/Eclipse.ini for general documentation for eclipse.ini files; for memory analyzer the file is called MemoryAnalyzer.ini – user13762112 Apr 27 '23 at 09:16
  • 1
    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. – niaomingjian Apr 28 '23 at 03:16
1

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

Nicolas Dupouy
  • 450
  • 1
  • 7
  • 11