score:240

Accepted answer

in eclipse from your project:

  1. right-click on your project
  2. click properties
  3. java build path: libraries; remove the "jre system library[j2se 1.4]"
  4. click add library -> jre system library
  5. select the new "execution environment" or workspace default jre

score:-1

i was getting project warning as "build path specifies execution environment j2se-1.5. there are no jres installed in the workspace that are strictly compatible with this environment". i removed the j2se1.5 library and added new jre system library which resolved my problem

score:-1

expand your project in work space>>right click(jre system libraries)>>select properties>>selectworkspace default jre the above solution sol

score:0

just change the version in window-> preferences-> java -> installed jres. check the installed jres list. then, right-click on your project -> properties -> java build path -> libraries. change the "jre system library" to the version in "installed jres".

the warning will be gone.

score:1

did you setup your project to be compiled with 1.4 compliance? if so, do what krock said. or to be more exact you need to select the j2se-1.4 execution environment and check one of the installed jre that you want to use in 1.4 compliance mode; most likely you'll have a 1.6 jre installed, just check that one. or install a 1.4 jre if you have a setup kit, and use that one.

otherwise go to your eclipse preferences, java -> compiler and check if the compliance is set to 1.4. if it is change it back to 1.6. if it's not go to the project properties, and check if it has project specific settings. go to java compiler, and uncheck that if you want to use the general eclipse preferences. or set the project specific settings to 1.6, so that it's always 1.6 regardless of eclipse preferences.

score:2

the correct procedure to resolve this warning, as other people write, is to go inside your project properties and click on java build path located on the left. now you will find inside the libraries window the j2se 1.5, double click on this one and a new window will give you the possibility to choose the correct excecution environment. now select your version and the warning will disappear.

score:2

i met the same warning in sts (spring tool suite), if it may help someone somehow.

this is the source https://www.baeldung.com/eclipse-change-java-version, and here's a summary of it :

warning : build path specifies execution environment javase-11. there are no jres installed in the workspace that are strictly compatible with this environment.

environment : ubuntu 20.04 (with default openjdk11) sts 4

to solve the warning :

  1. change the jre of the workspace of sts (by default, sts uses the jre embedded in its plugins) : window>preferences>installed jres>add>standard vm>directory (browse to your openjdk folder, in my case /usr/lib/jvm/java-11-openjdk-amd64)>finish)
  2. check the new jre, then apply and close
  3. now configure the spring-boot project to use the newly added jre : right click on the project > properties > java build path > in libraries tab > remove the old jre, then in modulepath add library > jre system library > environments (choose javase-11, make sure to check it on the right panel, mentionned "perfect-match"), apply and close

and voilĂ 

score:3

the actual cause of this warning is that you have configured your project to run with an earlier jre version then you have installed. generally this occurs whenever you use old projects with newer jres.

this will likely cause no trouble at all. but if you want to be really on the save side, you should install the correct, old jdk. you can find them here: http://www.oracle.com/technetwork/java/archive-139210.html

if you then restart eclipse you can go into window > preferences > java > installed jres > execution environments and set for in your case j2se-1.4 the [perfect match] as eclipse calls it.

score:3

if you have java 1.8 then

you need this xml part in pom.xml and update project.

 <properties>
    <maven.compiler.target>1.8</maven.compiler.target>
  </properties>

score:4

in eclipse preferences, go to java->installed jres->execution environment and set up a jre execution environment for j2se-1.4

score:11

the above solutions fix the project or work around the problem in some way. sometimes you just don't want to fix the project and just hide the warning instead.

to do that, configure the contents of the warning panel and make sure to toggle-off the "build path"->"jre system path problem" category. the ui for this dialog is a bit complex/weird/usability challenged so you might have to fiddle with a few of the options to make it do what you want.

score:186

whether you're using the maven eclipse plugin or m2eclipse, eclipse's project configuration is derived from the pom, so you need to configure the maven compiler plugin for 1.6 (it defaults to 1.4).

add the following to your project's pom.xml, save, then go to your eclipse project and select properties > maven > update project configuration:

<project>
 <build>
  <pluginmanagement>
   <plugins>
    <plugin>
        <groupid>org.apache.maven.plugins</groupid>
        <artifactid>maven-compiler-plugin</artifactid>          
        <configuration>
            <source>1.6</source>
            <target>1.6</target>
        </configuration>
    </plugin>
   </plugins>
  </pluginmanagement>
 </build>
</project>

Related Query

More Query from same tag