Home > Uncategorized > Maven-based NetBeans platform development with JRebel 6 – minor update

Maven-based NetBeans platform development with JRebel 6 – minor update

Some months ago I wrote about how easy it is to use JRebel for development of NetBeans platform module [1]. That article was focused mainly on standard ant-based modules. But recently I started to convert my plugins to the maven-based approach. At the same time I started testing JRebel 6 in an EAP. This combination didn’t work as described in one of my previous blog entries [2], but I figured it out and I like to document it using this blog post.

Steps to get maven-based nbms running using JRebel 6

  • enable “compile on save”
  • generate rebel.xml to /src/main using the context menu of jrebel (this way it will be copied to target/classes)
  • alter the properties-section of the pom.xml like this
        <properties>
            <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
            <netbeans.run.params.ide/>
            <netbeans.run.params>-J-noverify -J-javaagent:e:/tools/jrebel/jrebel.jar -J-Drebel.log=true ${netbeans.run.params.ide}</netbeans.run.params>
        </properties>
    
  • run the module – JRebel will create a bootstrap file in your temp directory once and will quit the execution
    JRebel: Starting logging to file: C:\Users\markiewb\.jrebel\jrebel.log
    [INFO] JRebel is now building a boot class cache.
    [INFO] This will only happen on this first run, or after manually deleting the rebel boot folder.
    [WARNING] JRebel bootclasspath not specified!
    [WARNING] Make sure to add -Xbootclasspath/p:C:/Users/markiewb/AppData/Local/Temp//rebelboot.jar to jvm arguments
    [WARNING] Otherwise this warning will appear again, and you won't be able to start your application
    [INFO] System will exit now, please restart the application to run with JRebel enabled.
    
  • add the bootclasspath argument with the path from the previous output to netbeans.run.params too (please note the “-J” prefix, that is important) (If NetBeans does not start, try to remove ${netbeans.run.params.ide} from the <netbeans.run.params>-parameter
        <properties>
            <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
            <netbeans.run.params.ide/>
            <netbeans.run.params>-J-noverify -J-Xbootclasspath/p:C:\Users\markiewb\AppData\Local\Temp\rebelboot.jar -J-javaagent:e:/tools/jrebel/jrebel.jar -J-Drebel.log=true ${netbeans.run.params.ide}</netbeans.run.params>
        </properties>
    
  • run the module – the application with your module and JRebel should start up
  • make changes to your classes and jrebel will pick them up

Tested with Win7 64bit, Oracle JDK 1.7.0u40, JRebel 6.0.0-M3, NetBeans IDE 7.4

 

Updates:
15/Mar/2014:

  • Tested with Win7 64bit, Oracle JDK 1.7.0u45, JRebel 6.0.0-M6, NetBeans IDE 7.4Patch2
  • Added comment about removing ${netbeans.run.params.ide}

[1] http://benkiew.wordpress.com/2013/05/01/netbeans-platform-development-with-jrebel-even-more-simplified/
[2] http://benkiew.wordpress.com/2011/12/28/netbeans-module-development-with-jrebel/

About these ads
Categories: Uncategorized Tags: , ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: