Using Javascript in Play 2.8

I’m relatively new to PlayFramework. Am trying to use a Javascript library (EasyUI), but can’t figure out how to. Are there any examples out there on how to configure for Javascript? I checked the Lightbend tutorials, but it’s not clear if any/which ones use javascript.

In online doc, I found that I should add

addSbtPlugin(“com.typesafe.sbt” % “sbt-rjs” % “1.0.9”)

to my plugins.sbt file.

But after doing that I get the following error when doing “sbt run”:

sbt.librarymanagement.ResolveException: Error downloading com.typesafe.sbt:sbt-rjs;sbtVersion=1.0;scalaVersion=2.12:1.0.9

1 Like

In plugin.sbt I’ve

addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.8.8")

In the build.sbt you have to put Java libraries that you need in your application. Javascript libraries are used in templates. I think.

1 Like

Thanks for the suggestion. I had the sbt-plugin line already in my plugin.sbt file.

Where I was getting the error with
addSbtPlugin(“com.typesafe.sbt” % “sbt-rjs” % “1.0.9”)
I just changed the version to “1.0.10” and it got rid of the error. I just googled sbt-rjs and that took me to a GitHub page where I saw the version number 1.0.10. That’s what gave me the idea to try it.

Beyond that, I’ve realizing that I don’t even need that sbt-rjs to run Javascript in my Play application. I’m still stuck though, as I can’t figure out how to use Javascript classes from a library that I’ve put in the public area. I’ll open a new post to hopefully get some help on that.