Of Code and Me

Somewhere to write down all the stuff I'm going to forget and then need

How to debug Play applications setup with the Typesafe stack from IntelliJ May 23, 2012

Filed under: IntelliJ,playframework,Web — Rupert Bates @ 8:18 pm
Tags: , ,

Windows:
Set your sbt.bat to the following:

set SCRIPT_DIR=%~dp0
set SBT_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9999
java %SBT_OPTS% -Xmx512M -XX:MaxPermSize=256m -jar “%SCRIPT_DIR%sbt-launch.jar” %*

Run SBT in your project folder and then the ‘run’ command

In IntelliJ set up a run configuration (Run/Edit Configurations) as follows:

Add a new ‘Remote’ configuration
Give it a name
Set transport to ‘Socket’
Set debugger to ‘Attach’
Set host to localhost set port to 9999 (so it matches the port you set in SBT_OPTS in the sbt.bat file)

Put in some breakpoints and hit debug.

 

I’ll add in Linux/MacOs instructions next time I’m at a Linux box…

About these ads
 

One Response to “How to debug Play applications setup with the Typesafe stack from IntelliJ”

  1. [...] How to debug Play applications setup with the Typesafe stack from IntelliJ Windows: Set your sbt.bat to the following: [...]


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.