Today, I wanted to build NetBeans from sources. I had no problem with it when building the release65 branch. But I needed to build development branch for next release and I've run into some problems.
First problem was Apache ant. My /usr/bin/ant is version 1.7.0. I'm not sure, where does this ant come from. Maybe its Apple's Xcode. But ant 1.7.1 is needed to build today's NetBeans sources. I like having my software up-to date without manual re-installation. Thus it's not surprising, that I really like apt-get in Ubuntu or Software Update in Mac OS X. But this /usr/bin/ant probably likes to be out of date. Luckily, I found out, that DarwinPorts is providing ant binaries. Exactly the way I like it, apt-get style.
Sadly, I was far from having complete NetBeans build. Running /opt/local/ant in NetBeans repository's main folder ended like this:
...
[repeat] The system is out of resources.
[repeat] Consult the following stack trace for details.
[repeat] java.lang.OutOfMemoryError: PermGen space
[repeat] at java.lang.ClassLoader.defineClass1(Native Method)
...
In the release65 times, the ANT_OPTS system variable had to be set properly, when you wanted to see the BUILD SUCCESSFUL message. So I double-checked it and it really was set like:
export ANT_OPTS=-Xmx512m
Though, I was still getting this unpleasant OutOfMemoryError. I had to do some googling, then I finally found out the solution. Another ant option has to be set:
export ANT_OPTS='-Xmx1024m -XX:MaxPermSize=512m'
The build finally finished successfully after setting the MaxPermSize. I'm not sure about minimal numbers which lead to successful build, I've just enlarged them both.

.
