Auto detect IP Address in java