It is strange: I consider myself still being new to Java, but when I search for particular sample code, that should be written thousand times before, I sometimes find only samples that do only half the job or miss important details.
So happened for getting the local IP address(es) of the machine you are running on. I experienced for example performance issues retrieving the IPs when running with a mobile internet stick (point-to-point device).
My example code can be found here: http://pastebin.com/5X073pUc
If you want just one address, that is probably the best fitting then you probable want to use this example: http://pastebin.com/PLAcTXac
Related post: Dynamic method invocation in Java 6.