IntelliJ IDEA Ultimate with Play Framework 2.6.7 Java imports 'symbol not resolved'

397 views
Skip to first unread message

b...@oasis9.net

unread,
Nov 24, 2017, 2:47:19 AM11/24/17
to Play Framework
This question is the same as the one I made on SO: https://stackoverflow.com/questions/47448572/intellij-idea-ultimate-with-play-framework-2-6-7-java-imports-symbol-not-resolv
---


Be it an example project, freshly downloaded from Play Framework's website, or my project which is derived from that with a few changes to templates - nothing big - IntelliJ just can't seem to find the appropriate dependencies or sources necessary for Play development.

I've already installed Scala plugin for IntelliJ, which includes support for Play Framework. I'll outline the process that I've followed, after reading multiple articles from Play's documentation as well as questions asked on here though no answer has proven incredibly useful as yet.

  1. Open Project Settings within IntelliJ IDEA Ultimate 2017.2.6
  2. Click Modules > [+] > Import Module
  3. Find build.sbt within project root
  4. Import with default SBT settings:
    • Download: [checked] Library sources, [checked] SBT source
    • [unchecked] Use SBT shell for build and import (requires sbt 0.13.5+)
    • Project JDK: [9.0 (java version 9.0.1)] -- Could this be the problem? (compatibility)

SBT compiles and I get this error, which I somewhat dismissed but reading it now seems to be somewhat telltale but I am unsure of what: https://pastebin.com/tXbHQdek

Running the site works, using sbt run, but when opening .java sources, IntelliJ marks errors upon import play.mvc.* though import views.html.* works fine. Adding framework support for Play 2.x seems to do next to nothing, as no project settings seem to change, and the error is not resolved.

This behavior exists with a clean IntelliJ 2017 Ultimate install (as of today) and an example project from Play Framework with no modifications, so if a solution cannot be found I'll probably consider posting an issue on one or more of their issue trackers.

Any ideas on how to get my Play Framework development environment working? Thanks :3

Will Sargent

unread,
Nov 24, 2017, 12:14:24 PM11/24/17
to play-fr...@googlegroups.com
There's a couple of things:

* You have a bind exception which indicates you have some JVM process already running
* it looks like JDK 1.9 is causing the downloads to fail due to librarymanagement not doing its thing:

  1. WARNING: An illegal reflective access operation has occurred
  2. WARNING: Illegal reflective access by sbt.internal.librarymanagement.ivyint.ErrorMessageAuthenticator$ (file:/C:/Users/nsnraven/.sbt/boot/scala-2.12.3/org.scala-sbt/sbt/1.0.2/librarymanagement-ivy_2.12-1.0.2.jar) to field java.net.Authenticator.theAuthenticator
  3. WARNING: Please consider reporting this to the maintainers of sbt.internal.librarymanagement.ivyint.ErrorMessageAuthenticator$


[error] sbt.librarymanagement.ResolveException: download failed: com.typesafe.sbt#sbt-native-packager;1.3.1!sbt-native-packager.jar(src)


--
You received this message because you are subscribed to the Google Groups "Play Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framework+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/3dbfda5c-cc3e-4cda-9b18-cd8cddd67528%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

b...@oasis9.net

unread,
Nov 25, 2017, 2:51:18 AM11/25/17
to Play Framework
Downgrading from Java 1.9 to 1.8 did the trick, thankyou :D
Aside from that, I am now having an issue with Twirl:

Is this the right way to supply two Html objects? I've noticed that if you place an opening brace the object becomes a Unit. Is there anywhere where this sort of syntax is explained more indepth than some examples on the documentation site?
It is possible to resolve the issue by beginning the file with @import play.api.templates.Html but I find this rather odd as it is not mentioned anywhere, though it somewhat makes sense, but then again it doesn't - I don't know.

Thankyou :3
Reply all
Reply to author
Forward
0 new messages