Update a Running JavaEE Application

Posted on by Nikolay Chashnikov

Next 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.

Comments below can no longer be edited.

17 Responses to Update a Running JavaEE Application

  1. Andrey V. says:

    October 29, 2009

    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?

  2. Antonio Goncalves says:

    October 29, 2009

    Does it mean we won’t need JRebel anymore ?

  3. Sanjiv says:

    October 29, 2009

    Can you explain how this is different from hot compile – ie compile of a class when connected using the debugger?

  4. igor spasic says:

    October 29, 2009

    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/

  5. Nikolay Chashnikov says:

    October 30, 2009

    The action will appear in the next EAP (after 90.122). It also works if application is started in ‘debug’ mode.

  6. Nikolay Chashnikov says:

    October 30, 2009

    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.

  7. Nikolay Chashnikov says:

    October 30, 2009

    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.

  8. Nikolay Chashnikov says:

    October 30, 2009

    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).

  9. GeekyCoder says:

    October 30, 2009

    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.

  10. Dave says:

    February 3, 2010

    Does this deploy updated Flex artifacts as well?

  11. Alexander Doroshko says:

    February 5, 2010

    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/

  12. Alexander Doroshko says:

    February 8, 2010

    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.

  13. Dmytro says:

    October 13, 2010

    Is it possible to update classes on JBoss EAR application with EJB3 ?

  14. Nikolay Chashnikov says:

    October 14, 2010

    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.

  15. Florent Clairambault says:

    September 24, 2013

    For people still interested by that. The best way I found to easily update a java class on the server on IDEA is to make a Ctrl+S Ctrl+S shortcut. The first Ctrl+S saves normally and the seconds deploys.

  16. jahen says:

    March 5, 2018

    I Have select the Don’t ask again option. How to restore?

    • Nikolay Chashnikov says:

      March 5, 2018

      Switch on ‘Show dialog’ option after ‘On Update action’ label in the run configuration settings (Run | Edit Configurations).

Subscribe

Subscribe for updates