Update a Running JavaEE Application
October 29th, 2009 by Nikolay ChashnikovNext Maia EAP build includes new action that lets you quickly update a running JavaEE application after you changed its code. To invoke it, either press Ctrl+F10, or click this button on the Run tool window bar:

IntelliJ IDEA will allow you to select what to update in application:

Settings are saved in a current Run Configuration, so you can change them later even if you select Don’t ask again option.
Tags: application servers, java ee, maia

October 29th, 2009 at 10:38 am
Great feature!
However, I have two questions.
Firstly, in what EAP is it included?
Secondly, does it work only for ‘Run’ or for ‘Debug’ either?
October 29th, 2009 at 11:19 am
Does it mean we won’t need JRebel anymore ?
October 29th, 2009 at 12:50 pm
Can you explain how this is different from hot compile - ie compile of a class when connected using the debugger?
October 29th, 2009 at 1:47 pm
Why don’t you make this happens automatically? Why to press a hotkey when this can be done on save?
Just like: http://code.google.com/p/idea-autopackage/
October 30th, 2009 at 1:35 am
The action will appear in the next EAP (after 90.122). It also works if application is started in ‘debug’ mode.
October 30th, 2009 at 4:20 am
To Antonio:
no, it isn’t replacement for JRebel. This action just copies modified resources to an exploded directory and performs plain Java HotSwap for modified classes.
October 30th, 2009 at 5:12 am
To Sanjiv:
This action not only compiles modified classes but also copies modified resources to an exploded directory. So, for example, if you’re running Tomcat and changes some JSP files you can invoke this action, refresh the browser and you’ll see updated view of your pages.
October 30th, 2009 at 5:20 am
To igor:
I don’t think it is intuitive to press Ctrl+S for updating changed resources on app server. If you really need to save files you can press Ctrl+S. If you need to compile files you press Ctrl+F9 and IDEA will compile your files (and save it before that). If you need to update changed resource for a running JavaEE application you can press Ctrl+F10 and your resources will be updated (and saved before that, of course).
October 30th, 2009 at 11:51 am
Usability IMprovement
====================
Can the Close Button (X icon) be located directly after the Stop Button (Square icon) since the Close Button is commonly used to terminate the process and close the Run panel. Even more so, as the Close Button will be hidden away as the panel height is reduced (Especially in screen using in 800pixel height). It will be useful if Alt+Click on the Close will immediately terminate and close the panel, trespassing the confirmation dialog.
February 3rd, 2010 at 2:00 pm
Does this deploy updated Flex artifacts as well?
February 5th, 2010 at 6:24 am
If J2EE artifact contains Flex module output in its structure then *.swf and other Flex stuff will be updated in the same way as other resources. Press Ctrl+F9 to make Flex module and then Ctrl+F10 to update a running JavaEE application.
An example of such IDEA project is here: http://blogs.jetbrains.com/idea/2009/11/graniteds-projects-in-maia/
February 8th, 2010 at 11:32 am
Since the next IDEA release (or EAP) you’ll not need to compile Flex manually before updating a running J2EE application. If IDEA’s artifact contains Flex module compiler output then Ctrl+F10 will do both compilation and update.
October 13th, 2010 at 6:55 am
Is it possible to update classes on JBoss EAR application with EJB3 ?
October 14th, 2010 at 4:44 am
It should be possible if your application is deployed in exploded format. For an application deployed as EAR archive ‘update classes’ option isn’t available.