Tetsing IntelliJ in writing java websites

Java is a very powerful language esp when used in web programming. It is very fast with a huge resource of code and libraries. The usual pain in the neck in writing a web application is deploying and packaging the application. The process takes time and until the programmer runs the application to figure his mistake he or she will have to wait half a minute or so.

I found that a faster alternative is to use in-place deployment, where the compiled code exists beside the source and most web servers can use that easily. Moreover, some web-servers like resin and I believe recent versions of tomcat can compile the code themselves, which is a great idea and sometimes saves a lot of effort. However, I like to compile my code from the editor so I can see my errors and fix them.

So now, if the development environment compiles the code and the web server compiles the code both in the same spot sometimes you will end up with funny stuff. When I did that with eclipse, I turned off auto compilation in resin for my testing sandbox, and just left it on the production side. By that way the compiled code is only the result of eclipse.

When I tried to do the same with intelliJ and change the output directory to be the same as the source, I got tons of complaints from the intelliJ saying that the files are changing while compiling. To solve the issue I ended up making intelliJ compile in an out directory, while leaving resin to do its own compilation, essentially ending up with two binaries in the same sandbox & I couldn’t find a way around that.

Leave a Reply