Jetty Eclipse connection error: The method dumpStdErr() is undefined for the type Server

Jetty Eclipse connection error: The method dumpStdErr() is undefined for the type Server

我正在尝试使用此 link 在 eclipse 中为 Jetty 服务器 编写一个 helloWorld。但是,我无法弄清楚哪个库包含“ dumpStdErr() ”,因为我的编译器未定义它。此功能是否有任何替代方案?

import org.eclipse.jetty.server.Server; 

/*
* The simplest possible Jetty server.
*/ 
    public class SimplestServer { public static void main( String[] args ) throws Exception {
    Server server = new Server(8080);
    server.start();
    server.dumpStdErr();
    server.join(); } }

您没有在依赖项中使用 recent/stable 版本的 Jetty。

参见:http://download.eclipse.org/jetty/stable-9/apidocs/org/eclipse/jetty/server/Server.html

dumpStdError() 方法 was added in Jetty 7.3.0 并且从那以后在每个版本中都存在。

Note: Jetty 7 and Jetty 8 are EOL (End of Life), do not use them anymore. Upgrade to Jetty 9 at your first opportunity.