Handler error while trying to execute Jetty Server

I get error: incompatible types: org.eclipse.jetty.servlet.ServletHandler cannot be converted to org.mortbay.jetty.Handler While trying to run my below code. I'm new to Java and not sure why this is happening. Any ideas? (I'm using JDK 11 and the latest Jetty versions 9.3 and IDE IntelliJ)

package newJetty;

import newJetty.handler.PingHandler;
import org.eclipse.jetty.servlet.ServletHandler;
import org.mortbay.jetty.Handler;
import org.mortbay.jetty.Server;
 * Hello world!
public class JettyServer
    public static void main( String[] args ) throws Exception {
        Server server = new Server(8080);

        ServletHandler handler = new ServletHandler();

        handler.addServletWithMapping(PingHandler.class, "/ping");


The default behavior is that the absolute file path is used to uniquely identify files - I would like customize this to use the md5 checksum of the file. Is it possible to simply implement a custom ...

How can I create implementations of an interface dynamically at runtime in java? I have a factory that will read the annotations on class Foo and create an instance of class Bar. For this factory to ...

I'm trying to understand recursion with the help of few examples. I found this example of printing all possible combinations of r elements in a given array of size n using recursion. Print all ...

I need to create some directories and files and all of them should have permission 0600. When I Run from NetBeans Debug: After creating directory when i try to store some files there I get IOException ...