Tuesday 16 August 2016

Can not add project to tomcat server in eclipse or Dynamic web module 3.0 requires java 1.6 or newer or Project facet Java version 1.7 or 1.8 is not supported or There are no resources that can be added or removed from the server.

Can not add project to tomcat server in eclipse or Dynamic web module 3.0 requires java 1.6 or newer or Project facet Java version 1.7 or 1.8 is not supported or There are no resources that can be added or removed from the server.


Can not add project to tomcat server in eclipse


  1. Right click on project name in Package Explorer View.
  2. Select Properties
  3. Select Project Facets in left panel.
  4. Check the Dynamic Web Module 
  5. And click on OK



Dynamic web module 3.0 requires java 1.6 or newer if you get this error follow below.

You will get all these error because of upgrading java version.

First check that your project is configured probably to use java 1.7
Note if you upgrade your java version to 1.8.x use 1.8.x  instead of 1.7.x(in all places).

Right click on your project->Properties-> Java Compiler and set "Compiler compliance level" to 1.7 


















Next from the menu on the left select Project Facets or Right click on your project>Properties->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 proejct'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...
This solution was tested using: java 1.7 and Maven v3.1




If  You get Project facet Java version 1.7 or 1.8 is not supported

That is because you just changed your JRE location in the workspace property(or jre upgraded to latest verion ), which TOMCAT relies on.

Please reset your tomcat property accordingly again:

In eclipse you can change the java version from your tomcat ,see picture.


Now the problem is resolved you can add the project to tomcat and hit the url like
http://localhost:8080/ProjectName.
http://ipaddress:portnumber/ProejctName/sourcename
url.





1 comment: