Showing posts with label netbeans. Show all posts
Showing posts with label netbeans. Show all posts

Sunday, February 24, 2008

Installing NetBeans 6.0 on Ubuntu-7.10

I followed the instructions mentioned in this NetBeans Wiki to install NB 6.0 on my ubuntu.

But I feel some more information can be added to this wiki.

For example, when i ran the command "sudo apt-get install sun-java6-jdk", ubuntu complained to me that this package is not found in its repositories.

The problem here is that the package sun-java6-jdk is available in the ubuntu "multiverse" repository which is disabled by default.

In ubuntu, the repositories are defined in the file "/etc/apt/sources.list". Take a backup of this file, in case if you want.

Now open this file and uncomment the lines which define the "universe" and "multiverse" respoitories.

It should look something like this now:

# Line commented out by installer because it failed to verify:
deb http://us.archive.ubuntu.com/ubuntu/ gutsy universe
# Line commented out by installer because it failed to verify:
deb-src http://us.archive.ubuntu.com/ubuntu/ gutsy universe
# Line commented out by installer because it failed to verify:
deb http://us.archive.ubuntu.com/ubuntu/ gutsy-updates universe
# Line commented out by installer because it failed to verify:
deb-src http://us.archive.ubuntu.com/ubuntu/ gutsy-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
# Line commented out by installer because it failed to verify:
deb http://us.archive.ubuntu.com/ubuntu/ gutsy multiverse
# Line commented out by installer because it failed to verify:
deb-src http://us.archive.ubuntu.com/ubuntu/ gutsy multiverse
# Line commented out by installer because it failed to verify:
deb http://us.archive.ubuntu.com/ubuntu/ gutsy-updates multiverse
# Line commented out by installer because it failed to verify:
deb-src http://us.archive.ubuntu.com/ubuntu/ gutsy-updates multiverse


The job is not done yet.

Run the command "sudo apt-get update" in the terminal to instruct ubuntu to update the package details w.r.t the repositories we enabled just now.

The process might take some time. Wait patiently.

Once the update is done, ensure that the "sun-java6-jdk" package is available in the repositories, by issuing the command "apt-cache search sun-java6-jdk". You might get something like this in the terminal window:

james@kuttima-gifty:/etc/apt$ apt-cache search sun-java6-jdk
sun-java6-bin - Sun Java(TM) Runtime Environment (JRE) 6 (architecture dependent files)
sun-java6-jdk - Sun Java(TM) Development Kit (JDK) 6
sun-java6-jre - Sun Java(TM) Runtime Environment (JRE) 6 (architecture independent files)


Now we are rest assured that our desired packages are available.

Now run the commmand "sudo apt-get install sun-java6-jdk" in the terminal. Depending on your connection speed, this might take quite some time.

Then just follow the instructions to complete the installation.

In the meanwhile, don't forget to download the "netbeans 6.0" installer from netbeans.org. Once you downloaded the installer, you can run it by navigating to the appropriate folder.

In my case, i needed to issue the following command:

sudo sh netbeans-6.0.1-ml-javaee-linux.sh


This will invoke the netbeans installer and just follow the instructions to complete the installation process.

That's it, netbeans will install itself smootly on your machine.

Friday, November 9, 2007

Best feature in NetBeans 6.0

You might have heard tons of information about NetBeans 6.0 in recent days.

I'm using NetBeans 6.0 Beta 2 for almost 2 weeks now for some of my development activities.
Though it had lots of new features available, the new refactoring is the feature which impressed me the most.
(Note: So far, I have used the ide for Java SE projects only)

Refactoring in NetBeans 5.5 is good, but in 6.0 it's outstanding, i must admit.

I heard that refactoring has been improved in 6.0, but i didn't spend time reading what were the improvements.
So when i first pressed the shortcut key to refactor a local variable, it highlighted all the occurrence of the variable in blue and when i started to change the variable name in one place, all the highlighted occurrences were changed simultaneously. This is really excellent!!!


Figure 1: All the occurrence to be refactored are highlighted.

Now when i start changing it, all the highlighted occurences change simultaneously.



Figure 2: All occurences change simultaneously

This is the view after refactoring is done.


Figure 3: View after refactoring

Great, isn't it?

I was even more impressed when i stumbled across one more astonishing refactoring feature....

This time, i wanted to change a method name used in more than one class and what better than the netbeans refactoring?

I want to change a method name "getAESEncryptedText" to "getEncryptedText", but this method is referred in more than one class. So when i pressed "CTRL + R", this is what i got.


Figure 4: Refactor dialog


I wanted to have a preview of the places where this change will be effected. This is the preview offered by the ide:


Figure 5: Refactoring preview

That is outstanding. You can see exactly how the refactored code will look like in the preview pane.

I was thrilled by this offering from netbeans.

Now i'm motivated to compare the refactoring module offered by netbeans and eclipse.

Interesting times ahead for the developers....