Archive

Archive for September, 2010

Enable boxing errors in Eclipse

September 16th, 2010 No comments

Java 1.5 (5.0) and above support autoboxing conversions for primitives and wrapper objects. This will unclutter the code and give more flexibility to programmers, however this can have a negative impact on performance and can cause some unexpected behaviors. (Use boxing with care).

Eclipse by default will throw a warning if there are boxing and unboxing conversions in the code. If you want eclipse to throw an error during these conversions, follow the steps below –

Eclipse –> Window –> Preferences –> Java –> Compiler –> Errors/Warnings

scrn_enable_eclipse_autoboxing_error

If you want to learn more autoboxing in Java click here


Share
Categories: Tech Tips Tags: ,

How to find ports that are used in a windows machine?

September 10th, 2010 No comments

From time to time you might need to find all the ports that are used by other applications in your machine. Recently, I was installing a web server and I saw that the default port was already taken by some other application. There are many tools in market that will allow you to monitor and scan ports, but if you are simply looking to find available ports in a windows desktop or laptop you can can take advantage of the “netstat” tool provided with the windows OS.

Open command prompt and type
netstat -an
This will display all connections and listening ports in numerical form. If you have many ports open this will be a rather long list.



If you looking for a specific port, you can search inside the results provided by netstat. In the example below I am looking for all ports starting with port 80.
netstat -an | find “80”
scrn_netstat_findport_techthinking



If you want to be a little more specific, you can search search inside the results provided by the previous command. In the example below I am looking for all ports starting with port 80 and in listening status.
netstat -an |find /i “listening” | find “80”
scrn_netstat_findport_listening_techthinking

Share
Categories: Tech Tips Tags: ,