Review your favorite Linux distribution.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 02-25-2011, 05:07 AM   #1
LQ Newbie
Registered: Feb 2011
Posts: 2

Rep: Reputation: 0
Java Program to Display All IP Addresses in LAN

Hi Sir, I Want to Develop Network Scanner Software. For that i need "Java Program to Display All IP Addresses in LAN". Please, any one help me......
Old 02-25-2011, 05:25 AM   #2
Senior Member
Registered: Dec 2008
Posts: 4,680
Blog Entries: 29

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
Before people start bashing you here I would like to state that this is NOT the way
LQ goes, you need to SHOW your efforts, through code or through algorithms, what you have
read till now and where you are stuck etc.

Welcome to LQ.
Old 02-28-2011, 12:57 AM   #3
LQ Newbie
Registered: Feb 2011
Posts: 2

Original Poster
Rep: Reputation: 0
java program to display all ip addresses in lan

import java.util.*;
import java.lang.*;

public class GetOwnIP
public static void main(String args[]) {
InetAddress ownIP=InetAddress.getLocalHost();
System.out.println("IP of my system is := "+ownIP.getHostAddress());
}catch (Exception e){
System.out.println("Exception caught ="+e.getMessage());

This code shows only my system IP address.But, i want to display all systems IP addresses connected in my LAN Network. Please help me with code....
Old 03-01-2011, 11:49 AM   #4
LQ Newbie
Registered: Feb 2009
Posts: 8

Rep: Reputation: 0
Do you know the Network Range you are on. If not you would need to get your subnet to calculate the ip range. After you know the range you are looking for you can check out the link for icmp pinging. This might not work if firewalls don't allow ICMP responses.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Java Program to Display IP Address and Host Names in Wireless mahesh270 Programming 7 02-25-2011 08:45 AM
Different MAC addresses for same LAN card bhupeshchawda Linux - Networking 3 03-26-2007 04:50 PM
find ip addresses on lan allelopath Linux - Networking 9 05-03-2006 08:14 AM
Conflicting IP addresses in LAN? Joe Soap Linux - Networking 2 05-05-2005 04:36 PM
KDE Lan Browser doesn't display available LAN computers dance2die Linux - Newbie 2 01-16-2005 08:14 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:12 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration