Search code examples
javaeclipsejettyjava-server

Embed Jetty to JavaSE project


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.


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?