Monday, July 18, 2011

Installing Netbeans 7 and JDK on Ubuntu

So we installed the needed software now we need a comprehensive IDE editor for developing php applications. I use Netbeans because it has support for PHP. 

You can also use Eclipse as an alternative by installing PHP plug-in. You can also use the adapted to PHP Eclipse version called Aptana. It has predefined PHP plug-in and also debuger. You can get it at this page aptana studio

Now before we install Netbeans or Eclipse we need jdk preinstalled on Ubuntu. jdk stands for Java Development Kit and is the needed environment for Netbeans/Eclipse since they are developed as Java applications.

So now go to this page java downloads. Since we are installing on Ubuntu download the second option with no RPM in it. The package with RPM is for Fedora and RedHat Linux distributions. You will download a bin file.

After the download run terminal and browse to the downloads folder of your system where you downloaded the bin file. 
Next, type this command:

$ chmod a+x jre-6u-linux-i586.bin

Now replace the with the version of the jdk you downloaded. This will make the file executable since it wasn't. If you get any error you also use this command:

$ chmod 777 jre-6u-linux-i586.bin

Now run this command

sudo ./jre-6u-linux-i586.bin

This will now install java development kit on your computer. After this finishes we are ready to install netbeans.

Note: Eclipse is a java base application it doesn't need to be installed like netbeans. Just download extract and you are ready to use it without installation.  You might wanna visit this page for eclipse eclipse downloads. Now it is preety much handy to create a shortcut to you desktop and also create menu item in you system menu(In other post).

Now we will install Netbeans 7.0 . Go to this page netbeans downloads and download the package that has dot in the php row. This package has preinstalled plug-ins for php, zend framework and also other stuff. No you will get an *.sh file. When download finishes open terminal and go to the downloads folder.

Run this command:

$ sudo chmod +x name_of_netbeans_file.sh

This will make it executable file. Now run this command 

$ sudo ./name_of_netbeans_file.sh

This will now install Netbeans on your system.

Note: For windows systems choose the windows option and download and install the ms installer for netbeans.

Wait a while and after the install is finished got to the system menu -> programming -> Netbeans IDE 7.0 This will start the IDE. We will create an empty test project with these commands:

File->New Project ->PHP Application.

In the Name and Location dialogue window place the name of project "HelloWorldPHP" and in the sources folder there must be /var/www/ in from of the HelloWorldPHP, so your location would be /var/www/HelloWorldPHP. In the next steps leave all fields default and click finsih.

That's it you created your first PHP application in the Netbeans IDE.

Before you work on this post see first ubuntu installation

No comments:

Post a Comment