It works for macOS, but for Linux the command can vary based on the distro, not to mention Windows. For example, I'm using Manjaro and the default command to list addresses is ip a, which then needs some command line magic to extract the IP address.
We can use Java/Scala to get this information. This seems to work with my box (multiple interfaces, running together with docker and VMs)
Currently, to get local IP address, we use:
It works for macOS, but for Linux the command can vary based on the distro, not to mention Windows. For example, I'm using Manjaro and the default command to list addresses is
ip a
, which then needs some command line magic to extract the IP address.We can use Java/Scala to get this information. This seems to work with my box (multiple interfaces, running together with docker and VMs)