[java] java build path problems

From someone's project, I am getting this error:

Java Build Path Problems (1 item)
Build path specifies execution environment J2SE-1.5.  There are no JREs installed in the workplace that are strictly compatible with this environment.  

I have the latest JDK (jdk1.6.0_25). From my understanding, I can do one of the following:

  1. Download the J2SE-1.5 environment to match the project.
  2. Edit the project to agree with the latest JDK. How can I do this?

This question is related to java eclipse

The answer is


Go for the second option, Edit the project to agree with the latest JDK

  • Right click "JRE System Library [J2SE 1.5] in your project"
  • Choose "Properties"
  • Select "Workspace default JRE (jdk1.6)

enter image description here


From the Package Explorer in Eclipse, you can right click the project, choose Build Path, Configure Build Path to get the build path dialog. From there you can remove the JRE reference for the 1.5 JRE and 'Add Library' to add a reference to your installed JRE.


  1. Right click on project, Properties, Java Build Path.
  2. Remove the current JRE library.
  3. Click Add library > JRE System Library > Workspace default JRE.

To configure your JRE in eclipse:

  • Window > Preferences > Java > Installed JREs...
  • Click Add
  • Find the directory of your JDK > Click OK

Try this too in addition to MahmoudS comments. Change the maven compiler source and target in your pom.xml to the java version which you are using. Say 1.7 for jdk7

<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>