You are here

Netbeans

Submitted by Peter on Fri, 2012-10-12 20:19

This is about NetBeans (updated to 7.2) the application development environment, or IDE. My primary requirement is the development of PHP followed by SQL, CSS, XML, and a bunch of other formats I can handle as text if required. I also use Git and NetBeans has an optional integrated Git client.

Updated

A lot of people recommended Netbeans for various tasks. I tried it a few times without success and finally had some success with Netbeans 7 on Windows. This old article is updated from that first success with 7.0 to cover recent success and failure with 7.2.

Download

You can install the basic NetBeans for Java development from the Ubuntu Software Centre. You cannot install the PHP option from the Ubuntu Software Centre and have to use the download at netbeans.org/downloads/index.html. Ubuntu 12.04 LTS installs an obsolete version of Netbeans 7.0 that does not work. Install anything that is later than the version supplied by Ubuntu.

I need the Linux version on two machines, the Windows version for a Windows 7 desktop, and a windows version for Windows XP on a desktop. I did need Netbeans for Windows 7 on a notebook but dumped Windows for Ubuntu Linux 12.04 LTS and now I find Ubuntu 12.04 is worse that Windows for Web development.

Negatives

There are many reasons I avoided NetBeans up until today.

  • It is based on Java.
  • Unreliability. What did you expect, it is based on Java.
  • Java is owned by Oracle. Oracle will find a way to make a big profit from it.
  • Netbeans is designed for Java.
  • The PHP option is recent.
  • Some other important options are recent additions or recently stable.

Positives

There are several reasons why I decided to persist with Netbeans 7.1.

  • Val Paliy recommended NetBeans for PHP when the PHP option first became useful.
  • NetBeans 7.1 appears to be stable on several computers used by several people in the PHP Web development area.
  • The main Eclipse PHP option does not work with the other Eclipse options I want to use.
  • A quick look at NetBeans 7.1 today suggests NetBeans is better at integrating components than Eclipse.
    • A test of the NetBeans PHP download along side the Eclipse equivalent shows Netbeans to be twice as fast and use half the amount of memory. Eclipse appears to load all the junk all the time. Netbeans loads only the minimum required for PHP.
    • A test of the NetBeans PHP along side the Eclipse equivalent shows the NetBeans interface is faster because of better integration. I could set up a project with source and Git access almost a minute faster. I could make a medium complexity GIT update a minute faster for the same reason.

When you use an IDE, an Integrated Development Environment, you expect the components to work together smoothly. Eclipse lets you plug in a lot of extra modules but then the modules work as if they are unrelated applications. NetBeans has fewer add-on modules and the ones that do exist, cooperate. If NetBeans has all the modules you need, they will work together better than the same selection of add-on modules in Eclipse.

If you are developing in Java and using data dictionaries and everything else, Eclipse might be the only option. For PHP, Git, and a small list of other options, NetBeans appears to cover everything.

Java version

The advertising for Java says you install Java once in any platform then everything works under Java. The reality is most Java applications fail frequently, most Java applications are very sensitive to the version of Java you use, and you have to install a separate Java for everything. Both NetBeans and Eclipse arrive with Java included. For every equivalent download, NetBeans varies from 90% to 50% of the size of the Eclipse equivalent. Plus NetBeans has many of the add-on modules included while Eclipse has them as separate downloads.

NetBeans 7.1 found an acceptable version of Java in the default version of Windows 7.

Download size

The download size is important if you do not have access to unlimited broadband. The NetBeans PHP package is 46 MegaBytes and suggests, but does not require an 11 MB Java download. The equivalent Eclipse download is 86 MB and does not work, forcing you into an Eclipse download of over 200 MB.

Installation on Linux

The PHP download file is a .sh file and contains an installation script written in some ancient language from the early days of Unix. The .sh voodoo starts a proper installation process. Linux does not know what it should do with the .sh file. The first step after the download is to make the .sh file executable. Right click on the downloaded file, select Properties then the Permissions tab then tick the box next to Execute then close the Properties box. Now you can right click on the installation file and select Open.

Wait a while before you see any action. The .sh script ticks away a few seconds decompressing the file without an indication of anything happening. This part takes nearly a minute on my netbook.

You press enter until the installation is finished then NetBeans starts. There are a small number of boxes to tick which I will add later.

Once question is about accepting the license. Say yes and continue.

Another question is a request to breach your privacy and send information back to NetBeans/Oracle. Say no to continue. You can read the terms and conditions later then, possibly, agree to let NetBeans send information back to Big Brother at Oracle.

The installation process stops and NetBeans starts. You have another long wait. 40 seconds on my netbook. NetBeans is not an application to start and stop for occasional use.

Second start

The second time you start NetBeans there is a nag screen to try to breach your privacy. Say no.

There is a start screen about tutorials and things. Switch off the automatic start box, close the screen, then start using NetBeans. You should not see nag screens on the next start.

Speed

Intel Atom 1.5 GHz netbook: Too slow. Use Bluefish for editing files. Only use NetBeans at the end of the day for a sync to Git.

2.3 GHz dual processor: Sluggish compared to Bluefish. Will use NetBeans for making small changes to files already in Git. When Git is not needed, will use Bluefish.

Intel 3.3 GHz processor with 4 cores: 16 GB of memory running at 2 GHz. SSD. NetBeans is almost fast enough to use all the time.

Tutorials

Quick start tutorial

netbeans.org/kb/docs/java/quickstart.html contains a quick tutorial about the NetBeans IDE and creating projects. The tutorial uses NetBeans 6.9 and 7.1 is almost the same. The tutorial uses Java. The PHP download offers PHP instead of Java. Project creation is similar.

PHP offers the choice of a local application without existing source code, a local application with existing source code, and a remote application accessed via FTP. I use the remote application for some projects so I can keep one set of code on a test server then access that code from either my notebook or my desktop.

Some of the projects will reside in Git and I have to look further into configuring a PHP project for Git. SmartGit is so much better than every other Git interface that Netbeans Git would have to be spectacular to replace Smartgit.

Git

netbeans.org/kb/docs/ide/git.html tells you how to set up NetBeans for Git.

PHP

netbeans.org/kb/trails/php.html has links to pages about using NetBeans for PHP development.

7.2

Netbeans 7.2 works on Windows 7 and is broken on Ubuntu 12.04 LTS. on Linux the menus are unreadable and it is hard to test anything else. If I had a dual boot machine, Netbeans is one of the applications I would use only on Windows.