Recently, I tried to use java-image-scaling library to resize the image files. So, I set java-image-scaling jar file through Eclipse as a way that usual Eclipse project sets its external jar file. In Eclipse, there is no error (I mean, there is no red underline.) to use java-image-scaling library. However, when I try to compile it through Play! console, the compiler said it cannot find java-image-scaling jar file. It is weird because I did exactly same with Joda Time library and there was no problem.
Am I missing something to use external jar(java library) in a project of Play framework?
Check this screenshot that shows I already added Joda datatime library and java-image-scaling library.
You have to add your dependency in the project/Build.scala
file:
val appDependencies = Seq(
"com.mortennobel" % "java-image-scaling" % "0.8.5"
)
Or you can drop your jar directly in a lib
folder of your Play app.
Then, in the Play console, regenerate the Eclipse files using the command eclipsify
or eclipse
according to your Play version (2.1.x or 2.0.x).
For Joda time, it worked because this library is already existing in the Play dependencies.
Please refer to the Play documentation for further details.
Here you find the procedure to add external jar in your project if you don't want to use dependencies: Add external Jar file to Play 2.0.4
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