In Windows, using the tracert <host>
command gives us the intermediate ip addresses, How to do this in Java, other than using Runtime
class ?
Asked
Active
Viewed 103 times
0
![](../../users/profiles/2526437.webp)
cyberpirate92
- 2,728
- 2
- 24
- 40
-
1You can't. `traceroute` does it with the ICMP protocol, which isn't accessible in standard Java. You would have to use one of the numerous JPcap implementations, wrappers over `libpcap`. – user207421 Aug 06 '14 at 07:53
-
http://stackoverflow.com/questions/2627706/how-to-to-icmps-and-traceroutes-in-java – Wundwin Born Aug 06 '14 at 07:55
-
Or you can call `tracert` or `traceroute` from Java to get it to do the hard work. – Peter Lawrey Aug 06 '14 at 08:29