GWT Development With IntelliJ IDEA Community Edition
As you know recently JetBrains released open source version of IntelliJ IDEA. If you look at comparison matrix it is shipped with a small number of core plugins such as Ant/Maven integration, supports several CVSs such as Subversion, Git and CVS. But event with such limited functionality it can be competitive with other open source IDEs such as Eclipse or NetBeans, because, it is my opinion, IntelliJ IDEA is the best Java IDE that I have ever used. I am using it last four or five years, several times I tried to use Eclipse or NetBeans, but finally I always came back to IntelliJ IDEA. I will use
- IntelliJ IDEA Community Edition
- GWT 2.0
First what I need is a new project with single Java module
Then I create a new GWT project. For this purpose I will use webAppCreator.cmd and create new IntelliJ IDEA External Tool (File -> Settings -> External Tools)
The most important thing in that dialog is parameters for webAppCreator.cmd
- $ModuleFileDir$ is the directory of the module file. Since webAppCreator uses src folder for source files you have to use the folder same name in IntelliJ IDEA module
- $Prompt$ displays an input dialog where you can define module name for webAppCreator.cmd
Now I am ready to create new GWT project. External too that was created on previous step is available in Tools -> GWT -> Create Project. In prompt dialog I am typing GWT module name, e.g. “gwt.GwtTest”. New GWT module is created, let’s try to compile it and launch. I have to append additional libraries from GWT and several project folders into classpath. Select tab “Dependencies” for your java module (File -> Project Structure) and append
- PROJECT_FOLDER/src folder
- PROJECT_FOLDER/war/WEB-INF/classes folder. It is not create by webAppCreator.cmd so you have to create it manually.
Now I am ready to compile and launch application. Select “Edit Configuration” from Run menu and create new configuration
We are ready to launch application. To run or debug application, select corresponding mode from Run menu. When you look at Jetty logs you can see a warning about missed gwt.server.GreetingServiceImpl, it happened because we did not set up compiler output properly. Open tab “Paths” in Project Structure dialog and change Output path to PROJECT_FOLDER/war/WEB-INF/classes
Voilà, several simple steps and IntelliJ IDEA Community Edition is ready for enterprise development.
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)