Building NetBeans IDE source for Python Development
For the generic guide to work with NetBeans sources, see http://wiki.netbeans.org/HgNetBeansSources
Obtaining the Sources
- Open a terminal (command prompt) window, and navigate to a directory (folder) where you want the code to reside.
- Clone the main repository to a directory. In this example, we have named it nbsrc:
hg clone http://hg.netbeans.org/main nbsrc
- Navigate to the nbsrc root directory, and clone the contrib repository.
hg clone http://hg.netbeans.org/main/contribThis will create the contrib directory containing the Python sources (and other community-supported projects).
- After the clone is over, go to the nbsrc/nbbuild directory and create the file user.build.properties with the following recommended entries:
cluster.config=python permit.jdk7.builds=true build.compiler=extJavac javac.compilerargs=-J-Xmx512m -J-XX:MaxPermSize=512m nbjdk.home=[Your JDK location here] nb.cluster.python=\ contrib/gsf,\ contrib/gsf.api,\ contrib/gsfpath.api,\ contrib/o.jython,\ contrib/o.jython.distro,\ contrib/python.console,\ contrib/python.core,\ contrib/python.debugger,\ contrib/python.editor,\ contrib/python.help,\ contrib/python.kit,\ contrib/python.options,\ contrib/python.platform,\ contrib/python.project,\ contrib/python.samples,\ contrib/python.testrunner,\ csl.api,\ nbjunit,\ o.n.insane,\ parsing.api nb.cluster.python.depends= nb.clusters.list=nb.cluster.nb,nb.cluster.platform,nb.cluster.ide,nb.cluster.python,nb.cluster.java
Line 1 tells 'ant' to build only the Python cluster.
Line 2 allows building with JDK 7.
Lines 3 and 4 point to the 'javac' compiler details.
Line 5: You must enter the path to your JDK here. On Windows, use double-backslashes e.g. nbjdk.home=C:\\Program Files\\Java\\jdk1.7.0_71
Lines 7+ define the Python cluster, and the cluster dependencies list.
- Now execute ant from the nbbuild directory. This starts the build process.
- After the build is successful, navigate to the nbbuild/netbeans/bin directory to fire up the NetBeans executable (netbeans[.exe]).
DebuggingIf you need to debug the resulting netbeans executable, add the following line to your user.build.properties :
and build again. You can follow the ‘Debugging the NetBeans Platform' guide as a starting point for debugging the NetBeans/Python environment.
Working with mercurial
Mercurial is the distributed version control software used by Netbeans and the Python NetBeans module. The starting point to use it is the 'Netbeans Mercurial How-to'
When working daily (or nightly!) in the Netbeans python code you may be faced with urgent simple fixes (ready to commit) mixed with more complex changes that you want keep locally until they reach a stable state. Meanwhile another developer has pushed modifications ready to be merged. This tricky situation may happen often and you'll may find yourself scratching your head when you see the infamous:
$ hg merge abort: outstanding uncommitted changes
Tor Norbye provided some good Mercurial tips regarding this scenario on his blog.
Before filing a bug, check for duplicates by searching Bugzilla at
If you find an existing report for your bug, please comment on it and/or "vote" for it.
Otherwise, file your newly-found bug under the Python category: http://www.netbeans.org/issues/enter_bug.cgi?component=python&issue_type=DEFECT