Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

All my java projects are giving errors after installing new JRE in Eclipse

Tags:

java

eclipse

I installed an older version of JRE all my projects start to give compiler errors . (There is a cross and (Unbound) message onBuild Path for project) When I checked, they still see the uninstalled JRE in path. I did some of them and changed one by one but isn't there a quick way to add new JRE to all my current projects at one time? I have almost 80 projects and to make them one by one is time consuming.

Thanks

like image 498
Lyrk Avatar asked Dec 31 '12 10:12

Lyrk


People also ask

How do I use JDK instead of JRE in Eclipse?

Setup Default JRE as JDKOn the first page of popup wizard, select "Standard VM", then click Next. Select JDK's path then press OK. On next page, verify the the JRE name and it's System libraries are recognized properly by Eclipse itself, then click Finish. Check the just created JRE entry on the list, then press OK.

How do I know if JRE is installed in Eclipse?

Launch Eclipse and follow these steps: Select Window > Preferences. The Preferences Window opens. In the Preferences window, go to the left panel, expand the Java item, and select Installed JREs.


2 Answers

Your projects are likely referring to their JRE using its name in the preferences. Go into your Installed JRE preference page and just make sure the new correct JRE that's actually there has the same "name" as the old one that's been uninstalled. In the future, set your projects' JREs using the Execution Environment (Edit that entry from the Libraries tab). Java Build Path Property page for the projectenter image description here

To fix all of your projects quickly, open the project .classpath files for a fixed project and the broken one, and use the Search menu to kick off a massive find/replace through all of your .classpath files.

like image 189
nitind Avatar answered Sep 23 '22 01:09

nitind


Right click on any projects->properties->java Build path->

      1)mark the JRE version in order and support 

      2)Add JRE system library in libraries.
like image 20
Murali Avatar answered Sep 26 '22 01:09

Murali