How to import playframework sources in eclipse?

After cloning the playframework from github and importing java sources into eclipse, many build errors appeared.

Running targets from an ant file in eclipse works fine, as well as directly from cli.

How can I fix these errors in eclipse?

I took the following steps to import the game into eclipse:

  • new β†’ other β†’ Java> New Java project from existing ant Buildfile
  • select play / framework / build.xml
  • check the box "Link to the assembly file in the file system"
  • Done
+7
source share
2 answers

Errors arise due to differences between the internal way to build eclipse and the classpath available to ant at runtime.

Eclipse first imports rt.jar from the system path. This can lead to the absence of dependencies in javax.net packages (for example, javax.net.ssl.SSLException), which is located in jsse.jar. To fix, correctly click on the project-> Properties-> Java Build Path-> Libraries-> Add Library-> JRE Library.

Secondly, the game has dependencies on classes from ant runtime. To fix, correctly click on the project-> Properties-> Java Build Path-> Libraries-> Add Library-> User Library There you must add a new user library (maybe call it ANT) and add all ant -jars from your ant installation ( / usr / share / ant / lib / worked for me). Then add this custom library to reproduce the project creation path.

+4
source

From Oliver's answer, I also had to add jce.jar lib to my class path.

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

+1
source

All Articles