【发布时间】:2011-04-14 20:03:19
【问题描述】:
我已经使用“Hello RCP”模板启动了一个非常基本的 Eclipse (Helios) RCP 应用程序。
我启用了 Maven 依赖管理并将 Spring 3 添加到 POM。
之后我创建了一个视图并将以下代码添加到我的视图中。
@Override
public void createPartControl(Composite parent) {
RestTemplate restTemplate = new RestTemplate();
String result = restTemplate.getForObject("http://www.example.com:8080/rest/{page}/{id}" , String.class, "mypage", "someid");
Text text = new Text(parent, SWT.BORDER);
text.setText(result);
}
当我运行应用程序时,我得到以下异常,
java.lang.ClassNotFoundException: org.springframework.web.client.RestTemplate
...
如果需要,我可以发布其余部分。
我想知道如何将 maven 依赖项添加到我的类路径中,或者是否还有其他问题?
谢谢
【问题讨论】:
标签: java eclipse maven-2 classpath rcp