Question

I downloaded jetty from http://download.eclipse.org/jetty/stable-9/dist/.

I can start/stop Jetty server. Also I know about tutorials on eclipse wiki. But I cannot find info how to add jetty to project on Java SE in eclipse.

Simply: org.eclipse.jetty.server.Server is not recognized.

Was it helpful?

Solution

If you want to embed Jetty you will need the to add the Jar file to your Build Path in Eclipse.

Jetty: http://download.eclipse.org/jetty/stable-9/dist/

The jars are located in the lib folder and you probably need the Jetty-server.jar file.

How to add a Jar to Build Path in Eclipse: Where to put the external jars?

OTHER TIPS

I assume you have your plugin sorted and it's now a compiler issue in your project. Check your build path for the project to see if you have the jetty jar included there.

I think this may be of interest

The following code from SimplestServer.java instantiates and runs the simplest possible Jetty server:

public class SimplestServer
{
    public static void main(String[] args) throws Exception
    {
        Server server = new Server(8080);
        server.start();
        server.join();
    }
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top