How to generate class files to target\*.* on the fly so JRebel can reload class files Follow
I've used JRebel with eclipse in the past without any issues; I set "build automatically' and point the output directory to maven default target class and as such I'm able to change the java files on the fly and allow JRebel to reload the classes.
In Idea, however, I'm unable to compile classes on the fly since the default Ajc compiler doesn't seem to compile classes on the fly. I'm not sure if changing to eclipse would help since I'd need Aspectj support.
I've made sure all my module settings are configured to have 'use module compile out path' check to .... {target\classes}
What am I missing?
The other alternative is to run maven build but it takes a long time, even without tests, since I have 18 modules to run.
Please sign in to leave a comment.
I don't see from your post - have you installed JRebel plugin for IDEA? Though on-the-fly compilation isn't supported by IDEA, the plugin should be able to reload updated classes after you say compile (Ctrl-F9).
IDEA itself also has a HotSwap feature (works if you started your project in a debug mode).
Yes, I'm using JRebel's official plugin. The plugin itself is working fine since it works when I start my tomcat (I can in the logs). The problem is with the IDE because Jrebel looks at the new classes in the target/classes structure and IntelliJ doesn't generate one.
In eclipse, this happens automatically.
Could it be because I use Ajc compiler?
You can just reassign Ctrl+F9 to Ctrl+S and that will seem like if you work with Eclipse :)
That is NOT the same as eclipse a Ctlr F9 'Makes' the ENTIRE project and I have 18 maven modules :)
Besides Idea 'Make' still doesn't work all the time as I use aspectJ, oh, well -- let's not get there as I just closed another thread last week.
How do I complile just one class?
Ctrl+Shift+F9
Perfect. Thanks.
How do you 'assign' Ctlr S ==> Ctrl Shft F9 (or any other keymap)?
Settings -> Keymap
Or you can actually press Ctrl+` (backquote) and in the the popup select Keymap and Switch to Eclipse shortcuts :)
I'd like to migrate to Idea's keymap and it'd help to have the option of assigning shortcuts in the interim.
Thumbs up! :) Then Settings -> Keymap is where you find the assigned shortcuts.
Hi to all.
Ctrl Shft F9 works for all java files, but doesn't work for resources.
How can I put all updated resources to target/class directory?
For resources, you can mark the directory where files are located as the "resources" directory: right click -> Mark Directory as -> Resources Root
The files will then be copied automatically to the target.
It'd already marked as resource root, but files coping only on rebuilding whole module, but I want on changes. Same as automatic build on save in Eclipse.
Is it possible?
Did you enable "Build project automatically" in the compiler settings?
Settings -> Build, Execution, Deployment -> Compiler
I've added it, but it didn't help =(
It looks like this feature doesn't work.
Verified - works for me. Try harder! :)
BTW, if you are using JRebel, you don't need the resources to be copied into the target directory. Instead, you can map them in rebel.xml file within the classpath element (if that was your original goal).
Thank you, it looks like that I need. I'll try to do it.
Alexey,
Ctrl-Shift-F9 works perfectly for resources. Would be great if you could create a sample project to reproduce the issue.
Roman,
I've created sample project, and it's works fine
Thank you.