After cloning playframework from github and importing java sources into eclipse there are a lot of build errors shown.
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:
To run a Play application: Create a new Run Configuration – From the main menu, select Run -> Edit Configurations. Click on the + to add a new configuration. From the list of configurations, choose “sbt Task”
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With