Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem getting local ip address

 
Tien Duong Nguyen
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Anybody knows how to get the computer ip address by using java ?

I have tried to use the method getInetAddress of ServerSocket class, but it always returns me the address 0.0.0.0. What I want is the computer static ip address or DHCP , e.g : 155.69.172.12

Really appreciate if anyone can help.

Regards,
 
David Harkness
Ranch Hand
Posts: 1646
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic