What do I need to do to set up a working run configuration for a GWT project using Errai, in IntelliJ IDEA 11 Community Edition (which does not include the GWT plugin)?
I have found instructions for running a GWT project in IntelliJ Community Edition and instructions for working with GWT, CDI and Errai in Eclipse, but when I put these together the run configuration fails to load my app. What configuration is needed?
To get a GWT/Errai project running from IntelliJ 11 Community Edition, go through the following steps:
Add GWT, Errai and your project source directory to the classpath
In the same way, add your project’s src directory. It may come up as ’empty library’ but don’t delete it. Open your project’s .iml file and find the lines referencing your /src and/or /src/main/java directories. If they are under the SOURCES element, move them to sit under CLASSES instead, so you have something like the following. Thanks goes to Stack Overflow user Vic for this hack, contributed to this post.
Create a run configuration
Add Program arguments equivalent to the following, substituting your project’s parameters. For a description of all the valid arguments, run the configuration with none and check the output.
Run the configuration and click Launch Default Browser in the GWT Development Mode window. Hopefully, your app will now load.
Troubleshooting