1

I have a non-web app maven project which relies on Kafka which is my message queue. now in order to do computation on incoming messages I need to run 4 JAR files concurrently. How can I use JRebel in this case so I can change my code and I don’t have to recompile those JAR files every time and run it again?

Any help would be appreciated.

Asav Patel
  • 1,113
  • 1
  • 7
  • 25

1 Answers1

2

Easiest is to setup JRebel using an IDE. JRebel has plugins for IntelliJ, Netbeans and Eclipse all of which can also set up IDE run configurations automatically.

However, it's also possible to prepare your jar-s with JRebel maven plugin.

If you want to run your JAR-files from command-line then IDE plugins contain instructions in JRebel settings > Startup > Run using CLI > Standalone application. Alternatively, you can find more general CLI instructions here.

andruso
  • 1,955
  • 1
  • 18
  • 26
  • I get this when I run it with JRebel java agent. `[IntelliJFSNotify] Event 'DIRTY' project_dir/target/classes/com/../` `[Core-Virtual] Evict cache for project_dir/target/classes` weird part is modified time on class file inside target/classes folder reflects the time when I modify the java file – Asav Patel Nov 23 '15 at 23:32
  • Do you use Eclipse? It auto-compiles class file when saving java file. – andruso Nov 24 '15 at 10:36
  • Great. Now check the output when running jars. Do you see jrebel banner? Does it contain "will be monitored for changes" for you target/classes? Does it contain "Reloading class" for your changed class? – andruso Nov 25 '15 at 10:09
  • yes I get that... here are the logs ```JRebel: Starting logging to file: /Users/asav/.jrebel/jrebel.log 2015-11-25 10:48:07 JRebel: Directory '/Users/asav/Workspace/java/project/target/classes' will be monitored for changes. 2015-11-25 10:48:07 JRebel: Contacting myJRebel server .. 2015-11-25 10:48:09 JRebel: ########################################################## 2015-11-25 10:48:09 JRebel: JRebel Legacy Agent 6.2.7 2015-11-25 10:48:09 JRebel: (c) Copyright ZeroTurnaround AS, Estonia, Tartu. 2015-11-25 10:48:09 JRebel: Over the last 1 days JRebel prevented``` – Asav Patel Nov 25 '15 at 18:49
  • The log doesn't fit into comment. Did JRebel reload your changes? – andruso Nov 26 '15 at 11:47