source: Dev/branches/play-2.0.1/documentation/manual/gettingStarted/IDE.md @ 322

Last change on this file since 322 was 322, checked in by hendrikvanantwerpen, 13 years ago

Added Play! framework and application with Jena dependency. Working on
the basic things now (login/register), after that start implementing
our data model.

File size: 4.2 KB
Line 
1# Setting up your preferred IDE
2
3Working with Play is easy. You don’t even need a sophisticated IDE, because Play compiles and refreshes the modifications you make to your source files automatically, so you can easily work using a simple text editor.
4
5However, using a modern Java or Scala IDE provides cool productivity features like auto-completion, on-the-fly compilation, assisted refactoring and debugging.
6
7## Eclipse
8
9### Generate configuration
10
11Play provides a command to simplify Eclipse configuration. To transform a Play application into a working Eclipse project, use the `eclipsify` command:
12
13without the source jars:
14
15```
16[My first application] $ eclipsify
17```
18
19if you want to grab the available source jars (this will take longer and it's possible a few sources might be missing):
20
21```
22[My first application] $ eclipsify with-source=true
23```
24
25
26
27You then need to import the application into your Workspace with the **File/Import/General/Existing project
** menu (compile your project first).
28
29[[images/eclipse.png]]
30
31You can also start your application with `play debug run` and then you can use the Connect JPDA launcher using **Debug As** to start a debugging session at any time. Stopping the debugging session will not stop the server.
32
33
34> **Tip**: You can run your application using `~run` to enable direct compilation on file change. This way scala templates files are auto discovered when you create new template in `view` and auto compiled when file change. If you use normal `run` then you have to hit `Refresh` on you browser each time.
35
36If you make any important changes to your application, such as changing the classpath, use `eclipse` again to regenerate the configuration files.
37
38> **Tip**: Do not commit Eclipse configuration files when you work in a team!
39
40The generated configuration files contain absolute references to your framework installation. These are specific to your own installation. When you work in a team, each developer must keep his Eclipse configuration files private.
41
42## IntelliJ
43
44### Generate configuration
45
46Play provides a command to simplify Intellij IDEA configuration. To transform a Play application into a working IDEA module, use the idea command:
47
48without the source jars:
49
50```
51[My first application] $ idea
52```
53
54if you want to grab the available source jars (this will take longer and it's possible a few sources might be missing):
55
56```
57[My first application] $ idea with-sources
58```
59
60You then need to import the application into your project (File->New Module->Import existing Module)
61
62[[images/idea.png]]
63
64> Tip: There is an [Intellij IDEA issue](http://devnet.jetbrains.net/thread/433870) regarding building Java based Play2 apps while having the Scala plugin installed. Until it's fixed, the recommended workaround is to disable the Scala plugin.
65
66To debug, first add a debug configuration
67
68- Open Run/Debug Configurations dialog, then click Run -> Edit Configurations
69- Add a Remote configuration, then select `Remote`
70- Configure it:
71    - Set a name
72    - Transport: Socket
73    - Debugger mode: Attach
74    - Host: localhost
75    - Port: 9999
76    - Select module you imported
77- Close dialog - click Apply
78
79Start play in debug mode:
80
81```
82$ play debug
83```
84
85which should print:
86
87```
88Listening for transport dt_socket at address: 9999
89```
90
91Set some breakpoints. Run the web app by executing the task `play` (again I had to do this in same terminal I ran `play debug`). Finally, browse `http://localhost:9000`. IntelliJ should stop at your breakpoint.
92
93If you make any important changes to your application, such as changing the classpath, use `idea` again to regenerate the configuration files.
94
95
96## Netbeans
97
98### Generate Configuration
99
100Play does not have native Netbeans project generation support at this time.  For now you can generate a Netbeans Scala project with the [Netbeans SBT plugin](https://github.com/remeniuk/sbt-netbeans-plugin).
101
102First edit the plugins.sbt file
103
104```
105resolvers += {
106  "remeniuk repo" at "http://remeniuk.github.com/maven"
107}
108
109libraryDependencies += {
110  "org.netbeans" %% "sbt-netbeans-plugin" % "0.1.4"
111}
112```
113
114Now run
115
116```
117$ play netbeans
118```
119
120> **Next:**
121>
122> – [[Play 2.0 for Scala developers|ScalaHome]]
123> – [[Play 2.0 for Java developers|JavaHome]]
Note: See TracBrowser for help on using the repository browser.