0

In building eclipse code, I have this "Build path specifies ..." error.

enter image description here

Build path specifies execution environment J2SE-1.4. There are no JREs installed in the workspace that are strictly compatible with this environment.

Googling to find this post : java build path problems to add J2SE-1.4 execution environments.

enter image description here

And checked Java SE 7 is installed correctly.

enter image description here

However, I still get the error. What might be wrong?

I have this information with java -version in my command line.

java version "1.7.0_07"
Java(TM) SE Runtime Environment (build 1.7.0_07-b10)
Java HotSpot(TM) 64-Bit Server VM (build 23.3-b01, mixed mode)
Community
  • 1
  • 1
prosseek
  • 182,215
  • 215
  • 566
  • 871

2 Answers2

1

You can try to go to Project|Properties, then Choose the Java Build Path, chose the current JRE System Library, and choose Remove.

Select Add Library, and under the JRE System Library category, select your system library; try to choose the Workspace default JRE

bhuang3
  • 3,493
  • 2
  • 17
  • 17
  • I have the same issue with other projects. Instead of setting for all of them one by one, is there an setup for all the projects? – prosseek Nov 30 '12 at 20:20
  • This only temporarily fixes the problem. Take a look at http://stackoverflow.com/questions/3138384/java-warning-build-path-specifies-execution-environment-j2se-1-4 – wei Sep 02 '14 at 16:56
0

You can try going into Preference|Java|Installed JREs. Click on Add... button. "Add JRE" page opens and select-Standard VM. On "Add JRE" page, next to "JRE Home",click on button "Directory". Under page "Browse for folder", find Program Files-> Java and find folder with JRE version e.g if the message said JRE 1.6 missing add the folder location JRE 1.6 in it like -> C:\Prgram Files\Java\jdk1.6_30

Val
  • 1