In Eclipse Juno, I installed the latest m2e plugin (1.2.20120903-1050). In preferences, I have added jdk1.7.0_11 in Java -> Installed JREs -> Add, and then specified the location (C:\Program Files\Java\jdk1.7.0_11). When I create a new Maven project and run it, I get a warning:
Build path specifies execution environment J2SE-1.5. There are no JREs installed in the workspace that are strictly compatible with this environment.
I am not sure how to resolve this.
I believe it is a Maven problem because I do not have this error when I run normal Java projects. I read here that I should change the "maven-compiler-plugin.pom" and change the source and target from 1.5 to something more appropriate. In my case, 1.7. I have done this, but I still get the warning.
All of the answers above may work for the time being but whenever you run maven on the command line or Maven → Update project… the JDK will be reset, this was also the question as I understand it.
To fix this for good add the following code to your pom file. Remember to do a Maven → Update project… afterwards or mvn clean compile at the command line.
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
Right-click on your project
Click Properties
Click the "Java Compiler" option on the left menu
Under JDK compliance section on the right, change it to "1.7"
Run a Maven clean and then Maven build.
I know this is an old topic. I had the same problem. I tested all the answers about this topic. And nothing worked here... but i found another solution.
Go to pom->overview and add these to you properties:
Name: "maven.compiler.target" Value: "1.7"
and
Name: "maven.compiler.source" Value: "1.7"
Now do a maven update.
For imported maven project and JDK 1.7 do the following:
Delete project from Eclipse (keep files)
Delete .settings directory, .project and .classpath files inside your project directory.
Modify your pom.xml file, add following properties (make sure following settings are not overridden by explicit maven-compiler-plugin definition in your POM)
<properties>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>
Import updated project into Eclipse.
I'm using Juno 4.2 with latest spring, maven plugin and JDK1.6.0_25.
I faced same issue and here is my fix that make default after each Eclipse restart:
List item
Right-click on the maven project
Java Build Path
Libraries tab
Select current wrong JRE item
Click Edit
Select the last option (Workspace default JRE (jdk1.6.0_25)
If you are getting following type of error
Then do the following steps-->>
Go to Windows. Then select Preferences, in Which select java(on the left corner).
In java select Installed JREs and check your JRE(if you have correctly installed jdk and defined environment variables correct then you will see the current version of the installed java here)as shown -
(I have Java 8 installed)
Check the check box if it is not checked. Click apply and close.
Now Press Alt+Enter to go into project properties,or go via right clicking
on project and select Properties.
In Properties select Java Build Path on left corner
Select Libraries
And click edit(after selecting The JRE System Library...)
In edit Click and select Workspace default JRE. Then click Finish
In Order and Export Check the JRE System Library.
Then Finally Apply and close
Clean the project and then build it.
Problem Solved..Cheers!!
In order to update your project to the latest version of java available in your environment, follow these steps:
Open your pom.xml file
Switch your view to Effective POM tab
Open Find Dialog (ctrl + F) to search for maven-compiler-plugin
Copy the the following lines
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
Click on pom.xml tab to open your project pom configuration
Inside your <build> ... </build> configuration section, paste the configuration copied and modify it as...
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
save your configuration
Right Click in your project Click on [Maven -> Update Project] and Click on OK in the displayed update dialog box.
Done!
I was facing the same issue. In pom.xml I have specified maven compiler plugin to pick 1.7 as source and target. Even then when I would import the git project in eclipse it would pick 1.5 as compile version for the project. To be noted that the eclipse has installed runtime set to JDK 1.8
I also checked that none of the .classpath .impl or .project file is checked in git repository.
Solution that worked for me: I simply deleted .classpath files and did a 'maven-update project'. .classpath file was regenerated and it picked up 1.7 as compile version from pom file.
I got an error in Eclipse Mars version as "Build path specifies execution environment J2SE-1.5. There are no JREs installed in the workspace that are strictly compatible with this environment.
To resolve this issue, please do the following steps,
"Right click on Project
Choose Build path
Choose Configure Build path
Choose Libraries tab
Select JRE System Library and click on Edit button
Choose workspace default JRE and Finish
Problem will be resolved.
When creating a maven project in eclipse, the build path is set to JDK 1.5 regardless of settings, which is probably a bug in new project or m2e.
I tested all the answers about this topic. And nothing worked here… but I found another solution.
Go to pom -> overview and add these to your properties:
Name: “maven.compiler.target” Value: “1.8”
and
Name: “maven.compiler.source” Value: “1.8”
Now do a maven update.
Related
When running a JUnit test, using IntelliJ IDEA, I get
How can I correct this?
Using SDK 1.7
Module language level is 1.7
Maven build works fine. (That's why I believe this in IDEA configuration issue)
Most likely you have incorrect compiler options imported from Maven here:
Also check project and module bytecode (target) version settings outlined on the screenshot.
Other places where the source language level is configured:
Project Structure | Project
Project Structure | Modules (check every module) | Sources
Maven default language level is 1.5 (5.0), you will see this version as the Module language level on the screenshot above.
This can be changed using maven-compiler-plugin configuration inside pom.xml:
<project>
[...]
<build>
[...]
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
[...]
</build>
[...]
</project>
or
<project>
[...]
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
[...]
</project>
IntelliJ IDEA will respect this setting after you Reimport the Maven project in the Maven Projects tool window:
IntelliJ 15, 2016 & 2017
Similar to that discussed below for IntelliJ 13 & 14, but with an extra level in the Settings/Preferences panel: Settings > Build, Execution, Deployment > Compiler > Java Compiler.
IntelliJ 13 & 14
In IntelliJ 13 and 14, check the Settings > Compiler > Java Compiler UI to ensure you're not targeting a different bytecode version in your module.
In IntelliJ IDEA 14.1 the "Target bytecode version" is in a different place.
The following change worked for me:
File > Settings... > Build, Execution, Deployment > Compiler > Java Compiler : change Target bytecode version from 1.5 to 1.8
Have you looked at your build configuration it should like that if you use maven 3 and JDK 7
<build>
<finalName>SpringApp</finalName>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
...
</plugins>
...
</build>
I ran into this and the fix was to go to Project Settings > Modules > click on the particular module > Dependencies tab. I noticed the Module SDK was still set on 1.6, I changed it to 1.7 and it worked.
I've found required options ('target bytecode version') in settings > compiler > java compiler in my case (intelij idea 12.1.3)
Modify the compiler setting file of the project in the following path and change the 'target' to 1.7:
/project/.idea/compiler.xml
<bytecodeTargetLevel>
<module name="project-name" target="1.7" />
</bytecodeTargetLevel>
I resolved it by setting the field blank:
Settings > Compiler > Java Compiler > Project bytecode version
Than IntelliJ uses the JDK default version.
From one moment to the other I also got this error without a clear reason. I changed all kinds of settings on the compiler/module etc. But in the end I just recreated the IntelliJ project by reimporting the Maven project and the issue was solved. I think this is a bug.
IntelliJ 12 129.961
I've hit this after just minor upgrade from IntelliJ IDEA 14 to v14.1.
For me changing an edit of top/parent pom helped and then clicked re-import Maven (if it is not automatic).
But it maybe just enough to Right Click on module(s)/aggregated/parent module and Maven -> Reimport.
I resolved bellow method
File >> Project Structure >> Project >> Project Language Level
--> do set proper version (ex: 1.5)
check
.idea/misc.xml
sometimes you need to change languageLevel="JDK_1_X" attribute manually
If it is a Gradle project, in your build.gradle file, search for following settings:
sourceCompatibility = "xx"
targetCompatibility = "xx"
For all subrpojects, in your root build.gradle file, you may put:
subprojects { project ->
sourceCompatibility = "1.7"
targetCompatibility = "1.7"
}
Although you can manually set language levels in Idea > Settings, if it is a Gradle project, Idea automatically synchronizes module .iml files from Gradle settings ( tested with Idea 15+). So all your manual changes are overriden when gradle is refreshed.
Based on Gradle documentation, if these are not set, then current JVM configuration is used.
I found another way to run into this error. You can get this if you have been re-organizing your directory structure, and one of your poms is pointing to the old parent which no-longer configures javac (because that configuration was moved to a middle level). If this happens the top level defaults to 1.5 and the misbehaving lower level pom inherits it.
So another thing to check when you see this error is that your pom structure is matching your directory structure properly.
If Maven build works fine, try to synchronizing structure of Maven and IntelliJ IDEA projects.
In the Maven tool window, click refresh button . On pressing this button, IntelliJ IDEA parses the project structure in the Maven tool window.
Note that this might not help if you're using EAP build, since Maven synchronization feature may be broken sometimes.
If all the previous solutions haven't worked for you (which was my case), you can delete intellij config files:
project_directory/.idea/compiler.xml
project_directory/.idea/encodings.xml
project_directory/.idea/misc.xml
project_directory/.idea/modules.xml
project_directory/.idea/vcs.xml
project_directory/.idea/workspace.xml
etc.
Intellij will regenerate new ones later.
However, BE CAREFUL, this will also delete all intellij configuration made on the projet (i.e: configuration of debug mode, ...)
You need to change Java compiler version in in build config.
Make sure right depency is selected.
File > Project Structure
Select your project and navigate to Dependencies tab. Select right dependancy from dropdown or create new.
I use IntelliJ IDEA as my development environment, and Maven for dependency management. I frequently build my project structure (directories, poms, etc) outside of IDEA and then import the project into IDEA using Import project from external model. This works great, except that in my poms I specify that the maven-compiler-plugin should use JDK 1.6, and when I import, IDEA informs me that the Language Level Changed and that Language level changes will take effect on project reload, and then prompts to reload the project. This is annoying because I always use the same JDK version.
How do I change the default JDK that IntelliJ IDEA uses, so that I don't have to reload my project every time I import a new project?
This setting is changed in the "Structure for New Projects" dialog. Navigate to "File" -> "New Projects Setup" -> "Structure..."
Next, modify the "Project SDK" and "Project Language Level" as appropriate.
Previous versions of IntelliJ IDEA had this setting in "File" -> "Other Settings" -> "Default Project Structure...".
IntelliJ IDEA 12 had this setting in "Template Project Structure..." instead of "Default Project Structure..."
Download and unpack a JDK archive file (.tar.gz) and add it as a SDK in the 'Project Structure' dialog box ( Ctrl+Alt+Shift+S )
click on the gif to enlarge
Also make sure to set an appropriate 'Project language level'. I forgot to do that when creating the GIF.
Project Structure > Project > Project language level
For Java 8 set it to 8, for Java 9 set it to 9, and so on.
I am using IntelliJ IDEA 14.0.3, and I also have same question. Choose menu File \ Other Settings \ Default Project Structure...
Choose Project tab, section Project language level, choose level from dropdown list, this setting is default for all new project.
I have found out that in recent versions of IntelliJ IDEA requires Java 1.8 but is not configured by default.
We can change the path or configure from Project Settings > Project > Project SDK
here we can edit or add the JDK´s path.
(in my case the path is located in C:\Program Files\Java\jdk1.8.0_102)
Change JDK version to 1.8
Language level File -> project Structure -> Modules -> Sources -> Language level -> 8-Lambdas, type annotations etc.
Project SDk File -> project Structure -> Project 1.8
Java compiler File -> Settings -> Build, Executions, Deployment -> Compiler -> Java compiler
One other place worth checking: Look in the pom.xml for your project, if you are using Maven compiler plugin, at the source/target config and make sure it is the desired version of Java. I found that I had 1.7 in the following; I changed it to 1.8 and then everything compiled correctly in IntelliJ.
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins>
</build>
The above responses were very useful, but after all settings, the project was running with the wrong version. Finally, I noticed that it can be also configured in the Dependencies window.
Idea 2018.1.3 File -> Project Structure -> Modules -> Sources and Dependencies.
To change the JDK version of the Intellij-IDE himself:
Start the IDE -> Help -> Find Action
than type:
Switch Boot JDK
or (depend on your version)
Switch IDE boot JDK
For latest version intellij, to set default jdk/sdk for new projects go to
Configure->Structure for New Projects -> Project Settings -> Project SDK
I am using IntelliJ 2020.3.1 and the File > Other Settings... menu option has disappeared. I went to Settings in the usual way and searched for "jdk". Under Build, Execution, Deployment > Build Tools > Maven > Importing I found the the setting that will solve my specific issue:
JDK for importer.
On my linux machine I use a script like this:
export IDEA_JDK=/opt/jdk14
/idea-IC/bin/idea.sh
In Eclipse Juno, I installed the latest m2e plugin (1.2.20120903-1050). In preferences, I have added jdk1.7.0_11 in Java -> Installed JREs -> Add, and then specified the location (C:\Program Files\Java\jdk1.7.0_11). When I create a new Maven project and run it, I get a warning:
Build path specifies execution environment J2SE-1.5. There are no JREs installed in the workspace that are strictly compatible with this environment.
I am not sure how to resolve this.
I believe it is a Maven problem because I do not have this error when I run normal Java projects. I read here that I should change the "maven-compiler-plugin.pom" and change the source and target from 1.5 to something more appropriate. In my case, 1.7. I have done this, but I still get the warning.
All of the answers above may work for the time being but whenever you run maven on the command line or Maven → Update project… the JDK will be reset, this was also the question as I understand it.
To fix this for good add the following code to your pom file. Remember to do a Maven → Update project… afterwards or mvn clean compile at the command line.
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
Right-click on your project
Click Properties
Click the "Java Compiler" option on the left menu
Under JDK compliance section on the right, change it to "1.7"
Run a Maven clean and then Maven build.
I know this is an old topic. I had the same problem. I tested all the answers about this topic. And nothing worked here... but i found another solution.
Go to pom->overview and add these to you properties:
Name: "maven.compiler.target" Value: "1.7"
and
Name: "maven.compiler.source" Value: "1.7"
Now do a maven update.
For imported maven project and JDK 1.7 do the following:
Delete project from Eclipse (keep files)
Delete .settings directory, .project and .classpath files inside your project directory.
Modify your pom.xml file, add following properties (make sure following settings are not overridden by explicit maven-compiler-plugin definition in your POM)
<properties>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>
Import updated project into Eclipse.
I'm using Juno 4.2 with latest spring, maven plugin and JDK1.6.0_25.
I faced same issue and here is my fix that make default after each Eclipse restart:
List item
Right-click on the maven project
Java Build Path
Libraries tab
Select current wrong JRE item
Click Edit
Select the last option (Workspace default JRE (jdk1.6.0_25)
If you are getting following type of error
Then do the following steps-->>
Go to Windows. Then select Preferences, in Which select java(on the left corner).
In java select Installed JREs and check your JRE(if you have correctly installed jdk and defined environment variables correct then you will see the current version of the installed java here)as shown -
(I have Java 8 installed)
Check the check box if it is not checked. Click apply and close.
Now Press Alt+Enter to go into project properties,or go via right clicking
on project and select Properties.
In Properties select Java Build Path on left corner
Select Libraries
And click edit(after selecting The JRE System Library...)
In edit Click and select Workspace default JRE. Then click Finish
In Order and Export Check the JRE System Library.
Then Finally Apply and close
Clean the project and then build it.
Problem Solved..Cheers!!
In order to update your project to the latest version of java available in your environment, follow these steps:
Open your pom.xml file
Switch your view to Effective POM tab
Open Find Dialog (ctrl + F) to search for maven-compiler-plugin
Copy the the following lines
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
Click on pom.xml tab to open your project pom configuration
Inside your <build> ... </build> configuration section, paste the configuration copied and modify it as...
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
save your configuration
Right Click in your project Click on [Maven -> Update Project] and Click on OK in the displayed update dialog box.
Done!
I was facing the same issue. In pom.xml I have specified maven compiler plugin to pick 1.7 as source and target. Even then when I would import the git project in eclipse it would pick 1.5 as compile version for the project. To be noted that the eclipse has installed runtime set to JDK 1.8
I also checked that none of the .classpath .impl or .project file is checked in git repository.
Solution that worked for me: I simply deleted .classpath files and did a 'maven-update project'. .classpath file was regenerated and it picked up 1.7 as compile version from pom file.
I got an error in Eclipse Mars version as "Build path specifies execution environment J2SE-1.5. There are no JREs installed in the workspace that are strictly compatible with this environment.
To resolve this issue, please do the following steps,
"Right click on Project
Choose Build path
Choose Configure Build path
Choose Libraries tab
Select JRE System Library and click on Edit button
Choose workspace default JRE and Finish
Problem will be resolved.
When creating a maven project in eclipse, the build path is set to JDK 1.5 regardless of settings, which is probably a bug in new project or m2e.
I tested all the answers about this topic. And nothing worked here… but I found another solution.
Go to pom -> overview and add these to your properties:
Name: “maven.compiler.target” Value: “1.8”
and
Name: “maven.compiler.source” Value: “1.8”
Now do a maven update.
When running a JUnit test, using IntelliJ IDEA, I get
How can I correct this?
Using SDK 1.7
Module language level is 1.7
Maven build works fine. (That's why I believe this in IDEA configuration issue)
Most likely you have incorrect compiler options imported from Maven here:
Also check project and module bytecode (target) version settings outlined on the screenshot.
Other places where the source language level is configured:
Project Structure | Project
Project Structure | Modules (check every module) | Sources
Maven default language level is 1.5 (5.0), you will see this version as the Module language level on the screenshot above.
This can be changed using maven-compiler-plugin configuration inside pom.xml:
<project>
[...]
<build>
[...]
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
[...]
</build>
[...]
</project>
or
<project>
[...]
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
[...]
</project>
IntelliJ IDEA will respect this setting after you Reimport the Maven project in the Maven Projects tool window:
IntelliJ 15, 2016 & 2017
Similar to that discussed below for IntelliJ 13 & 14, but with an extra level in the Settings/Preferences panel: Settings > Build, Execution, Deployment > Compiler > Java Compiler.
IntelliJ 13 & 14
In IntelliJ 13 and 14, check the Settings > Compiler > Java Compiler UI to ensure you're not targeting a different bytecode version in your module.
In IntelliJ IDEA 14.1 the "Target bytecode version" is in a different place.
The following change worked for me:
File > Settings... > Build, Execution, Deployment > Compiler > Java Compiler : change Target bytecode version from 1.5 to 1.8
Have you looked at your build configuration it should like that if you use maven 3 and JDK 7
<build>
<finalName>SpringApp</finalName>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
...
</plugins>
...
</build>
I ran into this and the fix was to go to Project Settings > Modules > click on the particular module > Dependencies tab. I noticed the Module SDK was still set on 1.6, I changed it to 1.7 and it worked.
I've found required options ('target bytecode version') in settings > compiler > java compiler in my case (intelij idea 12.1.3)
Modify the compiler setting file of the project in the following path and change the 'target' to 1.7:
/project/.idea/compiler.xml
<bytecodeTargetLevel>
<module name="project-name" target="1.7" />
</bytecodeTargetLevel>
I resolved it by setting the field blank:
Settings > Compiler > Java Compiler > Project bytecode version
Than IntelliJ uses the JDK default version.
From one moment to the other I also got this error without a clear reason. I changed all kinds of settings on the compiler/module etc. But in the end I just recreated the IntelliJ project by reimporting the Maven project and the issue was solved. I think this is a bug.
IntelliJ 12 129.961
I've hit this after just minor upgrade from IntelliJ IDEA 14 to v14.1.
For me changing an edit of top/parent pom helped and then clicked re-import Maven (if it is not automatic).
But it maybe just enough to Right Click on module(s)/aggregated/parent module and Maven -> Reimport.
I resolved bellow method
File >> Project Structure >> Project >> Project Language Level
--> do set proper version (ex: 1.5)
check
.idea/misc.xml
sometimes you need to change languageLevel="JDK_1_X" attribute manually
If it is a Gradle project, in your build.gradle file, search for following settings:
sourceCompatibility = "xx"
targetCompatibility = "xx"
For all subrpojects, in your root build.gradle file, you may put:
subprojects { project ->
sourceCompatibility = "1.7"
targetCompatibility = "1.7"
}
Although you can manually set language levels in Idea > Settings, if it is a Gradle project, Idea automatically synchronizes module .iml files from Gradle settings ( tested with Idea 15+). So all your manual changes are overriden when gradle is refreshed.
Based on Gradle documentation, if these are not set, then current JVM configuration is used.
I found another way to run into this error. You can get this if you have been re-organizing your directory structure, and one of your poms is pointing to the old parent which no-longer configures javac (because that configuration was moved to a middle level). If this happens the top level defaults to 1.5 and the misbehaving lower level pom inherits it.
So another thing to check when you see this error is that your pom structure is matching your directory structure properly.
If Maven build works fine, try to synchronizing structure of Maven and IntelliJ IDEA projects.
In the Maven tool window, click refresh button . On pressing this button, IntelliJ IDEA parses the project structure in the Maven tool window.
Note that this might not help if you're using EAP build, since Maven synchronization feature may be broken sometimes.
If all the previous solutions haven't worked for you (which was my case), you can delete intellij config files:
project_directory/.idea/compiler.xml
project_directory/.idea/encodings.xml
project_directory/.idea/misc.xml
project_directory/.idea/modules.xml
project_directory/.idea/vcs.xml
project_directory/.idea/workspace.xml
etc.
Intellij will regenerate new ones later.
However, BE CAREFUL, this will also delete all intellij configuration made on the projet (i.e: configuration of debug mode, ...)
You need to change Java compiler version in in build config.
Make sure right depency is selected.
File > Project Structure
Select your project and navigate to Dependencies tab. Select right dependancy from dropdown or create new.
I've created a web project in STS 2.9.2 using Spring 3.0.6 and Maven 3.0.3. I've created some pages and code with no errors.
I've upgraded Spring libraries version from 3.0.6 to 3.1.2 in project's pom.xml and now I get following error message:
Dynamic Web Module 3.0 requires Java 1.6 or newer.
Dynamic web module version and Java compiler version in project's faces are set to 2.5 and 1.6 respectively. Also set JRE system library for my project to 1.6.
I've tried to remove Maven nature and then add it again and JRE system library is set to JSE 1.5 automatically (but I have no Java 1.5 installed). I change JRE system library to 1.6 manually (to fix STS complaint about the JRE system library version) but error about dynamic web module remains.
I've googled for a fix but I've found nothing.
How can I solve that error?
First check that your project is configured probably to use Java 1.7.
Right click your project > Properties > Java Compiler and set “Compiler compliance level” to 1.7.
Next from the menu on the left select Project Facets > Java and set its version to 1.7
If you didn’t find 1.7 as one of the drop down options in the previous preferences, then you have to add it to eclipse first.
Navigate to eclipse Preferences > Java > Installed JREs, click Add, and locate your installed Java path.
Open your project’s pom.xml and add this plugin tag
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
Finally, right click on your project > Maven > Update Project…
Source: http://qussay.com/2013/09/13/solving-dynamic-web-module-3-0-requires-java-1-6-or-newer-in-maven-projects/
I couldn't solve this problem by modifying pom.xml, or deleting project and workspace files and restarting eclipse.
I fixed it by disabling Maven nature of the project and then re-enabling it.
I have the same problem. I delete project from eclipse. In console I type mvn eclipse:clean. After this in Eclipse I imported a maven project and it was a solution.