Eclipse – Change IDE’s JRE Version

Background

Really fumbling a lot here.

Trying to get the Hibernate Plugin to play well with Eclipse is becoming my fool’s errand.

Wifey

I did not know she had texted.  But, now I know as she is calling.

I could not reach for the phone in time.

But the text read, “When are you getting off work?“.

She is easy.

Her request is always around food.

This time it is pickup seafood. And, don’t forget they close at 9:30 pm.

 

Error Message

As I muddled my way around the Hibernate Wizards confronted with a fresh message.

It read :-

Image

window.hibernateConfigurations.01.20190506.0426PM

Textual

Project ‘helloDBHibernate03’ has higher compiler option than running EclipseHibernate plugins unable to load its classes.
Please decrease the compiler option or run the Eclipse with higher JDK level.

Explanation

I really like mouthful paragraphs that are easy to read and comprehend :-

  1. The error message states my current project’s compiler option is higher than Eclipse’s own JVM.
  2. As a result the Hibernate plugin can not be loaded
  3. To re-mediate
    • Change the project’s compiler option
    • Run Eclipse’s JDK Level

Lineage

I know that the issue is my changing my project’s JDK level.

That move is documented here :-

Eclipse – Changing Targeted JRE
Link

Remediation

I could revert the Project’s JDK level.

or try running Eclipse at a complementary JRE.

GUI

Wanted to do make the transition using the GUI.

But, could not find a way to do so.

Manual

Outline

  1. Ensure you have downloaded and installed the targeted JDK
  2. Configure Eclipse to use targeted JDK
    • Change needs to occur via eclipse.ini

Java Runtime

Java Runtime – v11

Artifact

JRE 11 is available here

artifact.jdk11.20190507.0933AM

Install

Installed JDK 11.

Review Install

The install is targeted at :-

java.install.folder.20190507.0936AM

Review Folder

Noticed :-

  1. Unlike earlier versions :-
    • Bundling
      • We do not have separate installs for JRE and JDK
      • We only have one JDK
    • Naming
      • Folder ( JDK versus JRE )
        • Previous ( < JDK 10 )
          • jre*
        •  New ( >= JDK 10 )
          • jdk*
      • Folder ( Decimal versus Whole)
        • Previous ( < JDK 10 )
          • 1.3
          • 1.8
        •  New ( >= JDK 10 )
          • 10
          • 11

Eclipse

Configuration File

Folder

Please access the eclipse folder

eclipse.winOS.folder.01.20190507.0930AM
eclipse.ini
Outline
  1. Backup eclipse.ini
  2. Modify the following entries
    • vm
      • original
        • -vm
          C:/Program Files/Java/jre1.8.0_181/bin
      • Revised
        • -vm
          C:/Program Files/Java/jdk-11.0.3/bin
    • vmargs
      • original
        • -Dosgi.requiredJavaVersion=1.8
      • revised
        • -Dosgi.requiredJavaVersion=11
    • add-modules
      • original
        • –add-modules=ALL-SYSTEM
          -Dosgi.requiredJavaVersion=1.8
      • revised
        • –add-modules=ALL-SYSTEM
          -Dosgi.requiredJavaVersion=11
Backup File

Please backup the eclipse.ini file.

It is the one we will be modifying.

File – Original

eclipse.revised.1.8.20190507.0953AM

File – Revised

eclipse.revised.11.20190507.0950AM

Validation

Outline

  1. Please restart Eclipse
  2. Use menu to access Eclipse About
    • The “Eclipse About” window appears
    • Please click the “Installation Details” button
    • Please access the “Configuration” Tab
    • The retrieving system Information message appears
    • Waited a few more for the Configuration details to appear

Configuration

v11

Image

jre.version.v11.20190507.1105AM

Text

-vm
C:/Program Files/Java/jdk-11.0.3/bin\server\jvm.dll

 

Dedicated

Life is good once you run into Amy :-

Amy DeGregorio
Baeldung
How to Fix java.lang.UnsupportedClassVersionError
Link

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s