Eclipse: library problem
Eclipse is giving the following error:
The type org.eclipse.jetty.http.HttpBuffers cannot be resolved. It is indirectly referenced from required .class files
For the following code:
import org.eclipse.jetty.server.Handler;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.handler.DefaultHandler;
import org.eclipse.jetty.server.handler.HandlerList;
import org开发者_开发技巧.eclipse.jetty.server.handler.ResourceHandler;
import org.eclipse.jetty.server.nio.SelectChannelConnector;
import org.eclipse.jetty.util.log.Log;
public class FileServer {
private FileServer() {
Server server = new Server();
SelectChannelConnector connector = new SelectChannelConnector();
connector.setPort(8080);
server.addConnector(connector); //Error this line
}
}
I am using the following jar files:
jetty-io-7.1.6.v20100715.jar
jetty-security-7.1.6.v20100715.jar
jetty-server-7.1.6.v20100715.jar
jetty-servlet-7.1.6.v20100715.jar
jetty-util-7.1.6.v20100715.jar
The error indicates that the Jetty classes in your program internally depend on the HttpBuffers
class in some way. You need to find and add the jetty-http-7.1.6.v20100715.jar
file to your project's build/classpath - it contains the HttpBuffers
class.
精彩评论