我正在使用Eclipse和Google App Engine插件。我正在尝试运行一个添加了joda时间的简单程序。似乎错误与构建路径有关,我按照以下说明操作: https://stackoverflow.com/a/12105417/3255963 但我仍然得到以下错误。接下来我需要做什么?
package test;
import java.io.IOException;
import javax.servlet.http.*;
import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;
@SuppressWarnings("serial")
public class testServlet extends HttpServlet {
public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
DateTime newYears = new DateTime (2014, 1, 1, 0, 0);
resp.setContentType("text/plain");
resp.getWriter().println("Hello, world");
}
}
错误:
java.lang.NoClassDefFoundError: org/joda/time/DateTime
我在项目资源管理器和构建路径中看到了joda-time-2.3.jar。
我也尝试在订单和导出下选择它。
答案 0 :(得分:2)