Can't run newly created app in IntelliJ IDEA: package org.junit does not exist

639 views
Skip to first unread message

to...@ceszke.com

unread,
Sep 8, 2015, 4:11:58 PM9/8/15
to play-framework
Hi,

I just created defect #5080 https://github.com/playframework/playframework/issues/5080 but was immediately closed so it either is not an issue or issue is well known.
I can't run new, fresh application in IntelliJ IDEA:

I created new play application (activator new tcc3 play-java) and imported it into IntelliJ IDEA.
Then I ran it using new SBT task (according to documentation).
Compilation completed with 11 errors and 1 warning:

D:\Projects\tcc3\test\IntegrationTest.java
Error:(1, 1) java: package org.junit does not exist
Error:(8, 24) java: package org.junit does not exist
Error:(18, 6) java: cannot find symbol
  symbol:   class Test
  location: class IntegrationTest
Error:(23, 17) java: cannot find symbol
  symbol: method assertTrue(boolean)
D:\Projects\tcc3\test\ApplicationTest.java
...

What I did wrong?

Carsten D.

unread,
Sep 9, 2015, 2:52:03 AM9/9/15
to play-framework
Just add JUnit to your libraryDependencies in your build.sbt:

"junit" % "junit" % "4.12" % "test"

to...@ceszke.com

unread,
Sep 9, 2015, 5:04:05 PM9/9/15
to play-framework

It solved my problem. Thank you!

I'm wondering why activator is able to run default java app without any additional imports in build.sbt.
It would be nice to do that in the same way in IDEA - as manual says - just create new 'Run Configuration' and run it.

Regards, Tomek.
Reply all
Reply to author
Forward
0 new messages