How To Build CND in the NetBeans trunk

This page describes how to build NetBeans with C/C++ pack from repository sources. Some parts are copied from general NetBeans pages HgHowTos and WorkingWithNetBeansSources. If you need more details on using Mercurial or NetBeans build system, refer to those pages.


You need the following to be installed on your machine

  • JDK 6 for NetBeans 6.9 or newer, JDK 5 for NetBeans 6.8 or older (it must be 1.5.0 because NetBeans must be runnable on this version of JDK or newer, by using 1.5.0 you will ensure that you don't use APIs and features available only in JDK 6 or newer)
  • Apache Ant 1.7.1
  • Latest Mercurial release (at least 1.0.2), presupposing Python 2.5.1 or later

Getting Sources

You need to clone CND team repository

hg clone cnd-main

Edit cnd-main/.hg/hgrc:

default =
# default-push is needed if you plan to push your changes.
# You need to know USER and PASSWORD to do it.
default-push =

username = Vasily Pupkin <>

fetch = 

One you have cloned cnd-main, further updates can be downloaded with

hg fetch

Building Sources

ant -Dcluster.config=cnd    (to build NetBeans & CND)
ant rebuild-cluster    (to rebuild just CND cluster)


ant -Dcluster.config=cnd clean (to clean NetBeans, cnd and other modules in cnd cluster)

Run sanity tests:

ant commit-validation

NOTE: Setting cluster.config=cnd does a much faster build, but won't checkout or build all modules needed to pass valiation.

If you work with the same cluster all the time, you can permanently set cluster.config and properties in nbbuild/ instead of typing them on the command lines.

Automated Builds

We have continuous build triggered on every commit to cnd-main:

Build failures are sent to Committers have to subscribe to this mailing lists (send a message to and monitor the traffic there. There is also a NetBeans plugin called build monitor which periodically reads the RSS feed from hudson and displays red/green light on the IDE status line.

Other useful commands

ant -p    (to print all the invokable targets in the build.xml)<br>

Trouble Shooting Tips

  • Another way to build the cnd cluster:
ant build-nozip -Dcluster.config=cnd -Ddo-not-rebuild-clusters=true (optional)
  • Can't build on Windows:
1. after checking out the sources and building unsuccessfully, delete openide.
2. checkout openide
3. cd nbbuild
4. ant real-clean
5. ant build-nozip
Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo