Search code examples
javaeclipseplayframeworkplayframework-1.x

How do I add Jars to the classpath in Play Framework?


My project needs to use some third-party jars. I assume I drop these in the lib/ directory in my project, but where do I configure Play to add them to the classpath?

I'm developing in Eclipse, and I know I can add them to the Eclipse project's build path, but this won't necessarily make Play reference them when it runs.


Solution

  • Play automatically adds all jars in the application's lib directory to the classpath.

    To quote:

    A play application classpath is built as follows (in this order):

    * The /conf directory for the application
    * The $PLAY_PATH/framework/play.jar
    * All jar files found in your application /lib directory
    * All jar files found in the $PLAY_PATH/framework/lib directory