You need to definite a server runtime. You can do that using api located
in this package:
org.eclipse.wst.server.core
The starting class for that api is called ServerCore.
Once you have create the runtime, you will be able to see it in the
Targeted Runtimes properties page of your project, but it will not be
selected, you can go back to the faceted project api.
Use the following method to find the runtime. Note that this IRuntime is
different than server.core's IRuntime.
org.eclipse.wst.common.project.facet.core.runtime.RuntimeManager.getRuntime(
<name>)
Then you will want to call
IFacetedProject.setTargetedRuntimes(List<IRuntime>) on your project.
- Konstantin