Error abotut version of dynamic web module reported by STS

I created a web project in STS 2.9.2 using Spring 3.0.6 and Maven 3.0.3. I created several pages and code without errors. I upgraded Spring from version 3.0.6 to 3.1.2 in the pom.xml project, and now I get the following error message:

Dynamic Web Module 3.0 requires Java 1.6 or later.

The version of the dynamic web module and the version of the Java compiler on the project faces are set to 2.5 and 1.6, respectively. Also install the JRE system library for my project on 1.6.

I tried to remove the nature of Maven and then add it again, and the JRE system library is automatically installed on JSE 1.5 (but I do not have Java 1.5 installed). I manually change the JRE system library to 1.6 (to fix the STS complaint about the version of the JRE system library), but the error remains in the dynamic web module.

I searched for corrections but did not find anything.

How can I solve this error?

+6
source share
3 answers

First check that your project is probably configured to use Java 1.7. Right-click your project> Properties> Java Compiler and set the "Compiler Compliance Level" to 1.7.

Next, on the left menu, select "Project Boundaries"> "Java" and set its version to 1.7. If you did not find 1.7 as one of the options in the drop-down list in the previous settings, you need to add it to eclipse first. Go to eclipse "Settings"> "Java"> "Installed JREs", click "Add" and find the installed Java path.

Open your pom.xml projects 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/

+6
source

I could not solve this problem by changing pom.xml or deleting project and workspace files and restarting eclipse. I fixed this by disabling the Maven character of the project and then turning it back on.

+3
source

I have the same problem. I remove the project from the eclipse. In the console, enter mvn eclipse:clean . After that, I imported the maven project into Eclipse, and that was the solution.

+1
source

Source: https://habr.com/ru/post/920483/


All Articles