Thursday, March 15, 2012

How to Set Up Play Framework 2.0 Javadocs for Eclipse

Play framework 2.0 was released a few days ago and many developers are wondering how to set up the Javadocs for Eclipse.  The documentation is quite lacking so I hope this post will show up on Google and save some people a few hours.

The Problem:
No Javadocs!
The Solution:
  • In Eclipse, select your project in the Project Explorer
  • In the menu bar, select Project > Properties > Java Build Path > Libraries
  • Scroll down and look for play_2.9.1.jar
  • Click the arrow on play_2.9.1.jar and set the Source attachment and Javadoc location
  • Edit the Source attachment, click External Folder, and point to play-2.0/framework/src/play/src
  • Edit the Javadoc location, click Browse under Javadoc URL, and point to play-2.0/documentation/api/java

The Result:
Yay Javadocs!
Some other helpful tips:

Be sure to install the Scala plugin for Eclipse here.  Play 2.0 now uses Scala so the plugin will fix any pesky problems in Eclipse where it can't resolve some classes and methods provided by the framework.

If you're using Git to host your Play projects, check out the sample .gitignore file here.  Just stick it into your Play project folder.  It automatically excludes all Eclipse configuration files and makes it easy to work across multiple environments and developers.

8 comments:

  1. Thanks, it indeed helped a lot!

    ReplyDelete
  2. cool man, too bad we have to do it for each and every jar that we want the docs/source integrated :P

    ReplyDelete
  3. You helped me not only for Play! but also for Android . Thanks Man

    ReplyDelete
  4. With Play! 2.x.x you can just run the command: "eclipse with-source=true" to download available src and javadoc jars and link them in the eclipse classpath that is generated. This should avoid needing to manually alter the classpath file, which can always be re-generated/updated with the "eclipse" command.

    Docs: http://www.playframework.com/documentation/2.2.x/IDE

    ReplyDelete
  5. By following these common steps, you will surely get the deleted data recovered in an easier way with the help of an effective software. The only thing that you need to consider is selecting the best software for your use. In order to get the best software installed for data recovery process, you need to approach a reckoned company. Only a professional and reputed IT company will serve you with the effective software for recovering the deleted data. read here

    ReplyDelete