[java] Warning - Build path specifies execution environment J2SE-1.4

I create a Maven project in Eclipse Helios. It works fine for a day, but then this warning shows up:

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

Since this message, the project stopped compiling and debugging. Does anyone have solution for this problem?

This question is related to java eclipse maven-2

The answer is


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.


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Ă 


In eclipse preferences, go to Java->Installed JREs->Execution Environment and set up a JRE Execution Environment for J2SE-1.4


Expand your project in work space>>Right click(JRE System Libraries)>>select properties>>selectworkspace default JRE the above solution sol


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.


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.


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>

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.


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


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>

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.


Examples related to java

Under what circumstances can I call findViewById with an Options Menu / Action Bar item? How much should a function trust another function How to implement a simple scenario the OO way Two constructors How do I get some variable from another class in Java? this in equals method How to split a string in two and store it in a field How to do perspective fixing? String index out of range: 4 My eclipse won't open, i download the bundle pack it keeps saying error log

Examples related to eclipse

How do I get the command-line for an Eclipse run configuration? My eclipse won't open, i download the bundle pack it keeps saying error log strange error in my Animation Drawable How to uninstall Eclipse? How to resolve Unable to load authentication plugin 'caching_sha2_password' issue Class has been compiled by a more recent version of the Java Environment Eclipse No tests found using JUnit 5 caused by NoClassDefFoundError for LauncherFactory How to downgrade Java from 9 to 8 on a MACOS. Eclipse is not running with Java 9 "The POM for ... is missing, no dependency information available" even though it exists in Maven Repository The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. on deploying to tomcat

Examples related to maven-2

Maven:Non-resolvable parent POM and 'parent.relativePath' points at wrong local POM Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project. Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved Maven Error: Could not find or load main class MAVEN_HOME, MVN_HOME or M2_HOME Where is my m2 folder on Mac OS X Mavericks Maven won't run my Project : Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec 'mvn' is not recognized as an internal or external command, operable program or batch file SLF4J: Class path contains multiple SLF4J bindings Create local maven repository