• 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

How to enable toggling between 2 JDK in Eclipse?

 
Ranch Hand
Posts: 821
  • 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: 821
  • 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: 24314
167
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.
reply
    Bookmark Topic Watch Topic
  • New Topic