Eclipse が起動しない JVM is not suitable for this product

Eclipse Pleiades 2020年版をインストールして起動したら、
JVM is not suitable for this product; Version 11 or grater is required
と表示され起動できなかった。
f:id:posturan:20210213231510j:plain

Java11 以降を前提としており、環境として Java8 で開発したり Java11 で開発したり
することがあり、デフォルトを Java8 のJREの PATH にしているとこのように
起動できない。

eclipse.ini で起動オプションに、JavaVM を指定させる。

-vm
C:/Java/jdk-11.0.2/bin/javaw.exe

のように、Java11 をインストールした場所を追加すると良いのだが、
注意が必要で最後に書いたのではダメで以下のようにする。

  • vmargs の前に書く!
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vm
C:/Java/jdk-11.0.2/bin/javaw.exe
-vmargs
-Dosgi.requiredJavaVersion=11
-XX:+UseG1GC
-XX:+UseStringDeduplication
--add-modules=ALL-SYSTEM
-Dosgi.dataAreaRequiresExplicitInit=true
-Xverify:none
-javaagent:dropins/MergeDoc/eclipse/plugins/jp.sourceforge.mergedoc.pleiades/pleiades.jar
-javaagent:lombok.jar