开发者

How to import playframework sources into eclipse?

After cloning playframework from github and importing java sources into eclipse there are a lot of build errors shown.

开发者_JAVA百科Running the goals from ant file in eclipse works fine as well as building from cli directly.

How can i resolve these errors in eclipse?

I took the following steps to import play into eclipse:

  • new -> other -> Java>New Java Project from Existing Ant Buildfile
  • select play/framework/build.xml
  • checking the 'Link to the build file in the file system' checkbox
  • Finish


The errors result from differences between eclipse internal build path and classpath available for ant at runtime.

First Eclipse only imports rt.jar from system path. This may lead to missing dependecies in javax.net packages (e.g. javax.net.ssl.SSLException), which is located in jsse.jar. To fix, right click on project->Properties->Java Build Path->Libraries->Add Library-> JRE System Library.

Second, play has dependencies to classes from ant runtime. To fix, right click on project->Properties->Java Build Path->Libraries->Add Library->User Library There you have to add a new User Library (perhaps call it ANT) and add all ant-jars from your ant installation (/usr/share/ant/lib/ worked for me). Then add this user library to play projects build path.


From the Oliver's answer, I had also to add the jce.jar lib in my classpath.

It comes from the $JDK/jre/lib directory.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜