0

I recently upgrades from Java 8 to Java 11 (i.e. java-11-openjdk java-11-openjdk-devel), primarily using this article for reference:

https://sysadminxpert.com/install-openjdk-11-on-centos-7/

And in Eclipse (Spring Tools Suite 4.1.0, I updated each of the following:

Window > Preferences > Java > Installed JREs to:

JRE home: /usr/lib/jvm/java-11-openjdk-11.0.9.11-0.el7_9.x86_64

JRE name: java-11-openjdk-11.0.9.11-0.el7_9.x86_64


Window > Preferences > Java > Compiler to:

Compiler compliance level: 11


And for each individual Java project, I edited the Build Path > Configure Build Path> Libraries Tab > Modulepath > JRE System Library to point to:

Execution environment: JavaSE-11 (java-11-openjdk-11.0.9.11-0.el7_9.x86_64)


However, each time I open up Eclipse I get a warning stating:

Missing JDK

The JRE you are running Eclipse with appears to not be a JDK.

Spring Boot Live hovers will not work with a plain JRE.

The JRE you are running Eclipse with is: /usr/lib/jvm/java-11-openjdk-11.0.9.11-0.el7_9.x86_64


I've tried googling this, but other issues look like they are actually tied to using a JRE instead of a JDK. In my case, it seems like everything is pointing to the JDK. Has anyone run into a similar issue and know how to fix it?
Pr0pagate
  • 199
  • 2
  • 12
  • 1
    I remember a similar thing from another SOF post, Could you check your JAVA_HOME variable, may bet set it to your java 11 jdk folder ? export JAVA_HOME='/usr/lib/jvm/java-11-openjdk-11.0.9.11-0.el7_9.x86_64'. Also it's a stretch but folder name might be causing a problem. Reducing it to "java-11-openjdk-11" might help – AntiqTech Aug 27 '21 at 12:49
  • 1
    https://stackoverflow.com/questions/11245865/java-home-does-not-point-to-the-jdk – AntiqTech Aug 27 '21 at 12:51
  • echo $JAVA_HOME shows /usr/lib/jvm/java-11-openjdk-11.0.9.11-0.el7_9.x86_64 . Tried renaming the folder, but that didn't seem to make a difference – Pr0pagate Aug 27 '21 at 14:04

1 Answers1

1

Mine works after edited the .ini:

  1. Quit Eclipse if it is running

  2. Go to the Eclipse installation directory and open the file eclipse.ini in a text editor.

  3. Search for the line -vmargs

  4. Before the line -vmargs, add two lines:

    On the first line, write -vm

    On the second line, write the path to your JDK installation (usually something like: C:\Program Files\Java\jdk1.6.0_31\bin\javaw.exe on Windows)

len
  • 376
  • 2
  • 19