Restlet服务器无法解析
我正在尝试设置一个简单的 Restlet 服务器。我已经阅读了 Restlet 网站上的教程。我已将“org.restlet.jar”文件绑定到我的类路径并尝试运行此代码:
import org.restlet.resource.Get;
import org.restlet.resource.ServerResource;
public class data_server extends ServerResource {
public static void main(String[] args) throws Exception {
// Create the HTTP server and listen on port 8182
new Server(Protocol.HTTP, 8182, data_server.class).start();
}
@Get
public String toString() {
return "hello, world";
}
}
然后 Eclipse 向我显示以下错误:
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
Server cannot be resolved to a type
Server cannot be resolved to a type
Protocol cannot be resolved to a variable
Part03 cannot be resolved to a type
at data_server.main(data_server.java:9)
有人可以帮助我吗?
im trying to setup a simple Restlet Server. I've reading the tutorials from the Restlet Website. I have bind the "org.restlet.jar" file to my classpath and try to run this code:
import org.restlet.resource.Get;
import org.restlet.resource.ServerResource;
public class data_server extends ServerResource {
public static void main(String[] args) throws Exception {
// Create the HTTP server and listen on port 8182
new Server(Protocol.HTTP, 8182, data_server.class).start();
}
@Get
public String toString() {
return "hello, world";
}
}
And then Eclipse show me the following error:
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
Server cannot be resolved to a type
Server cannot be resolved to a type
Protocol cannot be resolved to a variable
Part03 cannot be resolved to a type
at data_server.main(data_server.java:9)
Can somebody help me?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论