Fast NetBeans module development with JRebel – with screencast

This post is mostly obsolete: See http://wp.me/pIpWO-n0 for an updated version.


Based on a previous post https://benkiew.wordpress.com/2011/12/28/netbeans-module-development-with-jrebel/ i made a small video screencast to show how to use JRebel to improve your productivity when developing NetBeans modules.


1. Preconditions and setup

  • NetBeans 7.1.2/7.2.x installed (should work also with other version, but only these two were tested)
  • a valid installation of JRebel > 4.5.x (tested with 4.5.x, 4.6, 4.6.2, 5.0.0)
  • a valid license for JRebel – can also be the free social one – has to be configured in the JRebel configuration wizard
  • JRebel Netbeans Plugin 1.2 installed (use the update center) – required for debugging JRebel-instrumented code and generating rebel.xml
  • Change shortcut for “compile” to CTRL-S (Compile includes saving) – the equivalent to eclipse “Build automatically” or NetBeans “Compile on save” (Because “compile on save” is not yet available for module development projects)

2. Step by step

  •  Follow the instructions to generate a sample project @ http://platform.netbeans.org/tutorials/nbm-code-generator.html
  •  Select “Generate rebel.xml” in the context menu of your project, select the root path of your sources
  •  Add the following line to \nbproject\platform.properties (can be found in the Projects-panel named as “NetBeans Platform Config”)
    run.args.extra=-J-noverify -J-javaagent:d:/tools/JRebel/jrebel.jar -J-Drebel.log=true
    These parameters are taken from the offical JRebel documentation http://manuals.zeroturnaround.com/jrebel-reference-manual/server.html#server-4.6.1
  • Run the project -> a new NetBeans instance should be opened
    Note the output of the activated JRebel plugin in the output window of the development:
    JRebel: Starting logging to file: D:\tools\JRebel\jrebel.log
    [2012-05-19 12:05:05] #############################################################
    [2012-05-19 12:05:05]
    [2012-05-19 12:05:05] JRebel 4.6.2 (201205021440)
    [2012-05-19 12:05:05] (c) Copyright ZeroTurnaround OU, Estonia, Tartu.
    [2012-05-19 12:05:05]
    [2012-05-19 12:05:05] Over the last XXX days JRebel prevented
    [2012-05-19 12:05:05] at least XXX redeploys/restarts saving you about X,X hours.
    [2012-05-19 12:05:05]
    [2012-05-19 12:05:05] Over the last XXX days JRebel prevented
    [2012-05-19 12:05:05] at least XXX redeploys/restarts saving you about X,X hours.
    [2012-05-19 12:05:05]
    [2012-05-19 12:05:05] This product is licensed to XXXX
    [2012-05-19 12:05:05] until XXX
    [2012-05-19 12:05:05] #############################################################
  • Ignore the OSGI-exceptions (JRebel does not yet officially supports nbm-development) – UPDATE: this seams to be fixed in JRebel 5.0.0
  • Change the method content, change fields, do some refactoring …
  • CTRL-S for compiling including saving (see setup above)
  • execute the action in the target IDE again -> JRebel will reload the code

Advertisements

Netbeans: “Copy fully qualified name” plugin for 7.x – Update

As an eclipse veteran, i wondered why i could not copy the fully qualified name of the currently selected class to the clipboard. I looked it up, there is already a plugin Copy FQN. But it only runs with Netbeans 6.X.

So i introduced myself to the netbeans plattform api and migrated the plugin to be runable with Netbeans 7.1.RC2.

http://code.google.com/p/copyfqn-fork-for-netbeans71rc2/


Update: I rewrote the plugin and it is available at http://plugins.netbeans.org/plugin/42975/

Netbeans: “Show path in titlebar”-module version 1.2.1 is available

For more details and new features see http://code.google.com/p/show-path-in-title-netbeans-module/.

The package is already available for manual download at NetBeans PluginPortal. After the (currently pending) verfication the plugin will be automatically available via the NetBeans Update Center.

Netbeans: “Show path in titlebar”-module version 1.2 is available

For more details and new features see http://code.google.com/p/show-path-in-title-netbeans-module/.

The package is already available for manual download at NetBeans PluginPortal. After the (currently pending) verfication the plugin will be automatically available via the NetBeans Update Center.