0

On Windows (same question for Linux though), in eclipse.ini, I change -vm to C:\Users\k\bin\jdk-17\bin
Then I can see the change, etc

enter image description here

But during the debug, I notice Eclipse still use the default jre, not the one I specify, etc

enter image description here

What's the official way to specify the JRE used during the debug?

Thanks

kgflying
  • 194
  • 9
  • Does this answer your question? https://stackoverflow.com/a/13636584 – kiner_shah Jan 15 '22 at 10:10
  • The eclipse.ini only sets the JVM that Eclipse itself uses. The Run Configuration for your program sets the JVM used for that ("Run > Run Configurations") – greg-449 Jan 15 '22 at 10:13

1 Answers1

2

The change you made in eclipse.ini is about the JRE that is used to run Eclipse. It is nothing to do with the JRE that is used to run/debug an application.

To configure the JRE for debugging an application , right click the .java that you want to debug --> Debug As --> Debug Configuration. Then go to the JRE tab to configure at there. Something like below:

enter image description here

Ken Chan
  • 84,777
  • 26
  • 143
  • 172
  • Use _Exectution environment_ rather than a specific _Alternate JRE_ for choosing a JDK/JRE of a specific Java version. _Alternate JRE_ makes only sense when having more than one JDK/JRE for that Java version. – howlger Jan 15 '22 at 14:02