Building MyRCP..

Recently, I posted a question on NetBeans Forums as I was interested in knowing how to get started with building NetBeans Platform. So, I will be sharing the steps I followed that made my work easy.

Getting Started

Well, I have downloaded the source code for NetBeans Platform 6.X, as well as two JDK’s [1.5.0_22 - 64bit,  1.6.0_18 - 32bit] on Windows 7 – 64bit OS.  Assuming ANT_HOME, JAVA_HOME set properly and added to PATH.

It’s not necessary that you download the same JDK’s, however it’s necessary to have a copy of JDK 5 and 6. Because some versions of NetBeans code are built using JDK 5, while v6.8 can be built using JDK 6.

Steps To Be Followed

  1. Extracted the source code of NetBeans Platform 6.X under MyRCP\NbRcp_6X on my OS.
  2. cd some\path\to\MyRCP\NbRcp_6X
  3. cd nbbuild
  4. ant -Dcluster.config=platform build-platform -Dnbjdk.home=”%JAVA_HOME%”
    OR
    ant -Dcluster.config=platform build-platform -Dpermit.jdk6.builds=true
  5. Zip the netbeans directory created under MyRCP\NbRcp_6X\nbbuild directory and extract it wherever necessary/version-control the netbeans directory.

There you go, you have build your own RCP. Go, get started by adding the newly built platform in your NetBeans 6.X Platform Manager.

Jazoon ’10 | Call for Papers

After successful exhibitions in 2007 and 2008, Jazoon’09 drew a record 1,100 participants from 37 countries. Now, we’re currently seeking sponsors and exhibitors to take part in Jazoon’10.

Indeed,

Starting today the clock is running towards the submission deadline for the Jazoon’10 Call for Papers. Java and Open Source Experts from all over the world are called upon to actively participate in the steering of the program of Jazoon’10.

Proposals for short (20 minutes) and long talks (50 minutes) can be submitted within the scope of the technical sessions until 3 February 2010. Presentations can be held individually or together with a co-speaker. Speakers profit from preferential terms – details to be found here. Proposals for Jazoon Rookie (20 minutes) can be submitted until 4 April 2010. Participating criteria and benefits can be found here.

Other News

I am making a comeback on this blog with this post, hope to continue doing, what I love doing..

Reviewing NetBeans Book

This year, I received an email from Packt Publishing, inviting me to review one of the books based on NetBeans IDE, Java EE 5 Development with NetBeans 6. I was quite excited about this opportunity and after exchanging few mails with their Market Research Executive, accepted the invitation.

After nearly 2 months, I was able to finish reading the book and here’s my review of the book. Read it carefully and I feel you would enjoy reading the book as I did, because of its easy reading style and effectiveness of communicating complex topics.

Stay tuned..

taT | Hacking Project Properties

Yesterday, I recreated one of the Visual Library Sample  (basically a tutorial based on it at Dzone) using NetBeans 6.7 IDE on Windows XP Professional SP2. The sample was Java Application that had two JAR’s (present in the platform7 cluster of NetBeans 6.0 IDE) in its classpath.

I followed the tutorial and successfully executed the application. Fortunately, I have NetBeans IDE from 5.5 onwards, so there wasn’t any issue finding the JAR’s and adding them in the application’s classpath.

I didn’t knew whether it will work with cluster from higher release or not. Hence, I decided to give it a try by making use of clusters from 6.1, 6.5 and finally, 6.7.

Playing Tricks..

Now, removing/adding JAR’s again and again can be boring/cumbersome if you have several releases stored under different hierarchies of your filesystem. So, I looked into the various files created under /nbproject to inspect how these JAR’s being referred.

When you right-click Libraries Node and click Add JAR/Folder..

right-click Libraries Node (Click to enlarge)

You’re prompted with the dialog for browsing and then, selecting Reference/Absolute Path as per your choice.

Browse to select platform7 cluster (Click to enlarge)

I selected the platform7 cluster (see above figure) and selected the JAR’s shown in the following figure.

Selected JARs from platform7 cluster

/nbproject/project.properties

This file contains all the project related properties, that are accessed by build-impl.xml (created from project.xml automatically) for necessary Ant operations.

file.reference.org-netbeans-api-visual.jar=\
  path\\to\\cluster\\modules\\org-netbeans-api-visual.jar
file.reference.org-openide-util.jar=\
  path\\to\\cluster\\lib\\org-openide-util.jar
includes=**
jar.compress=false
javac.classpath=\
 ${file.reference.org-openide-util.jar}:\
 ${file.reference.org-netbeans-api-visual.jar}:\
 ${libs.swing-layout.classpath}

The bold-faced text is added, once referenced JAR’s are added from Projects Window/Project Properties Wizard. Also, path\\to\\cluster refers to the directory where the platform cluster is stored. In case of the above application, here’s the path;

E:\\OpenSource\\NetBeans_Archies\\NetBeans 6.0\\platform7

Playing with Clusters

Now, as you can see the path\\to\\cluster is the same in this case. So, I introduce another property that will have the path as value.

path.to.cluster.platform=\
  E:\\OpenSource\\NetBeans_Archies\\NetBeans 6.0\\platform7
file.reference.org-netbeans-api-visual.jar=\
  ${path.to.cluster.platform}\\modules\\org-netbeans-api-visual.jar
file.reference.org-openide-util.jar=\
  ${path.to.cluster.platform}\\lib\\org-openide-util.jar

This way, the referenced JAR’s become dependent on this property. Now, one can also change the value of this property, i.e. if one is interested in using JAR’s from platform cluster of higher releases of the NetBeans IDE.

Then, NetBeans will automatically scan the project, to update dependencies. For instance, I opted for platform9 cluster from NetBeans 6.5 IDE.

path.to.cluster.platform=\
  E:\\OpenSource\\NetBeans 6.5\\platform9

I just made changes at one place, that will be automatically reflected in other properties that depend on it directly/indirectly.

Tips to Remember

However, you need to check your code, once you do these changes, as this might cause warnings on deprecated usage of certain API, when you build your application.

Also, if you do any error while editing your project.properties as for this scenario, or any other. You may end up seeing lots of error badges in your code and possibly, get an added menu item (Resolve Reference Problems..) in the project’s context menu.

Stay tuned..