• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to enable toggling between 2 JDK in Eclipse?

 
Ranch Hand
Posts: 1021
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys,

I am now trying out a hyperskill developer solution which uses var which means I have to use a higher version of JDK.

Thus, I installed openJDK 10 in Eclipse.  The Oracle one just could not be downloaded.


OS : Window 10

Now, the problem is that in the workspace, the rest of the codes are all written using Java 8 JDK from oracle.

How can I make Eclipse toggle between Java 8 JDK if I want the codes to run in Java 8 and this particular code which needs to run in OpenJDK 10 in Eclipse.

So, there was some errors occurred and I as usual hastily deleted the Java 8 compiler from build path.

And now I am ended up with this screen which I had no idea how to make things work.

https://i.imgur.com/HCi6nk7.png

Hope to get some tips here.

Tks.
 
tangara goh
Ranch Hand
Posts: 1021
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry guys, I managed to enable the IDE to run 2 versions inside.  Please help me to delete this post.
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For the frustrated people who wondered:

Eclipse allows you to register multiple JDKs and JREs within itself, assigning a label to each one for easy reference.

Eclipse projects can then be set up to reference by label so that one project might be set up for Java 8 and another for Java 11, for example.

This isn't the same thing as compatibility levels, where you tell the compiler and JVM which level of source and class compatibility you want - those are separate project options.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic