Search code examples
javaeclipsedevelopment-environment

Eclipse: change JDK for all projects in Workspace


I have received a whole bunch of Eclipse Projects as a ZIP-File. I imported all of them into my new Workspace dedicated for this Task. They are all preconfigured from the other Dev's Workspace. In general I don't mind, so i do not have to setup every one of these Plugin-Projects.

What i do mind is that each and every Project is set to run with a specific JRE from the other guys installation (which I obviously don't have). Is there a convenient Way to change all the Projects in my Workspace to the Workspace default JRE?

I am really not looking forward to right click on every of these ~30 Projects and change it manually.


Solution

  • If they are not Maven or Gradle projects, you can change the .classpath XML files accordingly (<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/..."/>) using a shell/batch or Ant script. Then do a refresh (e.g. by selecting all projects and hitting F5) so that Eclipse is aware of the change.