Eclipse - Target runtime Apache Tomcat v7.0 is not defined

Eclipse Version: OXYGEN, 2017

  1. From the Project Explorer, right-click on your project > Properties > Project Facets
  2. On the left-hand panel, click on Runtimes tab.
  3. Select the Runtime (Apache Tomcat vX.0) you wish to implement.
  4. Click Apply and Close.

You should see this specific error go away. Regards.


Add your Tomcat 7 installation to your targeted runtimes. You can do it under menu Project > Properties > Targeted Runtimes

Select your desired runtime and provide the path where it is installed.


It might be that the org.eclipse.wst.common.project.facet.core.xml file in the .settings of your project have changed (e.g. if a colleague checks in their settings and then you pull their changes). In that case the Project > Properties > Targeted Runtime will be there and even checked (your original will be unchecked) but you will still have a problem.

You need to rename your runtime...

Window > Preferences > Server > Runtime Environments 

select yours > Edit

Change the name so that it is the same as your colleagues.

When you come to using your server that will also need to be updated...

double click on the server > General Information > Runtime Environment 

use the dropdown to select the new name


The targeted runtime version must be updated. Suppose you are using Tomcat Version 8.0 but in the targeted runtime it shows 7.0 selected.

You need to right click on your project > Properties > Targeted Runtime > Click the version required 8.0 I guess. Hope it helps.

Tags:

Eclipse

Tomcat