NetBeans

Introduction
NetBeans is popular open-source and free IDE that runs on Windows, Linux, Mac OS X and Solaris and includes support for several programming and scripting languages. You can find more info about NetBeans at http://www.netbeans.org/.

At this moment, the latest version of NetBeans that we have on Gentoo is 7.2. Latest stable version is 7.1.2. This guide generally applies to Netbeans since version 6.5 and does not describe installation of older versions of NetBeans. Also please note that all other version of (6.9, 7.0.1 etc) are currently masked by so they are not by default available for those on stable archs. (If you want to install latest NetBeans on stable arch, you can find info in this article too, just read on.)

In Gentoo, NetBeans is currently available for and  systems. If you want NetBeans also for other archs, file a bug at http://bugs.gentoo.org/.

Selecting NetBeans Modules
Before you install NetBeans, you should decide what modules you want to use, or you can simply decide to install all of them. Here is the list of available modules, though some of them do not have to be necesarily available in some NetBeans releases:

By default, emerging NetBeans installs NetBeans with Java development support. If you want to install NetBeans with only Java support, you do not have to adjust the list of modules. Otherwise read on this section.

Because there are dependencies among modules, it may take some time to configure emerge of NetBeans so that it can emerge the package. In case some of the needed modules is not specified, emerge informs you about what module might be missing so you can easily fix it.

Here is an example that you can use in case you want to install all NetBeans modules. Just add this line to your :

Selecting USE Flags
If you do not need JavaDoc API documentation for NetBeans sources, make sure to disable USE flag. Building documentation for NetBeans sources can take a lot of time.

Since netbeans-6.9-r3, you can turn on support for keychain by enabling. If you enable this, you will be able to benefit from keychain in NetBeans when connecting to ssh protected remote repositories. When you start NetBeans (from menu, from run window or from terminal, does not really matter), keychain will be run and keys that you can optionally specify will be added to ssh-agent and you will be prompted for key passwords if the keys are not managed yet. This is the first and last time NetBeans will ask you for key passwords. To specify keys that you want to add to ssh-agent on NetBeans startup, create file in your userdir (by default ) and put on each line single key that you want to load.

You can find more information about keychain at Keychain.

Custom Patches
Since you can also apply custom patches to NetBeans sources while emerging it. You can specify path on which NetBeans ebuild will look for patches and if any found, it will apply them before compilation.

This is useful for example when you want to modify how getters and setters are generated, like in this example.

Alternatively, you can use phase hooks feature of portage to apply custom patches.

Required Downloads
Year over year, the list of fetch restricted packages that need to be downloaded is getting shorter and shorter. Here are the lists for latest NetBeans versions. When facing a fetch restricted file, just download it according to the information issued by emerge and put it in. Then run the emerge again.

Portage
If you are on stable (so not using  packages) and NetBeans is still in, you need to put  and other needed  packages into. See

for details. Simply said, you need to put every package that is needed for emerge of NetBeans but masked with into your.

NetBeans
Some packages that are required by NetBeans may be keyword masked, including NetBeans itself, so you need to unmask it first to be able to compile NetBeans. With latest it's pretty easy, it just outputs information what to put where so you just copy and paste that information. You can make it even easier with switch.

You should see something like this at the end: Output of emerge -av netbeans

If everything is okay, you can now press and let Portage install NetBeans.

Running NetBeans
After NetBeans is emerged, you can run NetBeans 7.0.1 using command.

If you use other than English locale and you enabled it before installation, you can run NetBeans in your locale this way:

or

Troubleshooting
If you have some problems with emerge of NetBeans, you can contact fordfrog at #gentoo-java on FreeNode. If you come across a bug, file it to http://bugs.gentoo.org/. You can also find some help at http://forums.gentoo.org/. For help with problems that are not related to NetBeans on Gentoo see http://www.netbeans.org/kb/index.html.

Future Releases
If you want to go even further and want to use bleeding edge features of Netbeans, you can find ebuilds for latest development releases at http://git.overlays.gentoo.org/gitweb/?p=dev/fordfrog.git overlay. If you do not know how to use Gentoo Overlays, just read this Overlay guide. Even though it is development version of Netbeans, it is pretty stable and even usable for real work most of the time. Up to that, latest Netbeans installs on Gentoo always in new slot, so you can have older stable version and new bleeding edge version side by side on single system. To run the latest NetBeans, just run.

NetBeans