Aviv Carmi
Aviv Carmi

Reputation: 957

Play Framework Intellij community edition debug mode Java

I'm not able to run play project in debug mode in intellij IDE community edition. I've followed the instructions Play Framework setting up IDE page, and did not manage to catch any breakpoint from the IDE, I've also tried the answers here, here and here, and still nothing worked. Running activator -jvm-debug 9999 run from the console started the project, then running a remote debugging session on port 9999 from intellij also seemed to work, but breakpoints were not stopping the session at all.

I'm using Play Framework 2.4 and Intellij community edition 15.

Upvotes: 4

Views: 1852

Answers (4)

user2549726
user2549726

Reputation: 371

In intellij community:

  • Create new Run/debug Configuration
  • Select JAR Application

    Path to jar : /Users...../sbt-launch.jar
    VM options: -Xms512M -Xmx1536M -Xss1M -XX:+CMSClassUnloadingEnabled
    -debug 
    -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005
    Program arguments : run
    

Don't forget in build.sbt

fork in run := true

After you launch directly on Debug Button. Enjoy.

Upvotes: 1

Aviv Carmi
Aviv Carmi

Reputation: 957

SOLVED IT!

The reason breakpoints were not stopping on the IDE was because I a fork command at the end of my build.sbt file:

fork in run := true

As I deleted this line, everything worked as I expected.

No reason the community edition of intellij won't be able to debug a simple play application. This answer was very helpful for everyone who gets lots in his way to setting up a simple environment to develop and debug Play Framework application.

Upvotes: 7

Seroney
Seroney

Reputation: 427

PlayFramework Support is only available on Ultimate version and not the community version.Intellij Ultimate vs Community

Upvotes: 1

biesior
biesior

Reputation: 55798

Support for Play Gramework (and for other famous frameworks) is available for Ultimate version of IntelliJ Idea and that's obvious.

Guys from JetBrains does great job and they just need some kind of gratification for it!

Upvotes: 1

Related Questions