Update a Running JavaEE Application

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.

This entry was posted in New Features and tagged , , . Bookmark the permalink.

17 Responses to Update a Running JavaEE Application

  1. Andrey V. says:

    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. Does it mean we won’t need JRebel anymore ?

  3. Sanjiv says:

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

  4. igor spasic says:

    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:

    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:

    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:

    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:

    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:

    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:

    Does this deploy updated Flex artifacts as well?

  11. Alexander Doroshko says:

    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:

    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:

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

  14. Nikolay Chashnikov says:

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

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

    • Nikolay Chashnikov says:

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

Leave a Reply

Your email address will not be published. Required fields are marked *