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.    



Comments:

[Trackback]

Posted by informednetworker.com on November 25, 2008 at 05:43 PM CET #

hm, is is possible to run installation script, that you can get on netbeans.com?

Posted by burgua on November 25, 2008 at 10:24 PM CET #

burgua:
Sure, NetBeans installation on Mac OS X works just fine. Building from sources is necessary only when you're somehow involved in development of NetBeans.

Posted by Petr Chytil on November 26, 2008 at 12:04 AM CET #

Ah, good luck )

Posted by burgua on November 26, 2008 at 07:18 AM CET #

Post a Comment:
  • HTML Syntax: NOT allowed

This blog copyright 2009 by Petr Chytil