About: 15600 results

How to read all network cards with java - Stack Overflow
https://stackoverflow.com/questions/8613383/how-to ...
You can use Runtime.getRuntime().exec("ipconfig") for Windows and Runtime. getRuntime().exec("ifconfig") for linux to get ifconfig result in java. There is no way to get to the gory details here in 100% Java. You can either execute commands ...
Reading the output of a terminal command in java with ...
https://stackoverflow.com/questions/13000412/readi ...
Runtime.exec() needs some additional information to execute an Unix Command . So, assuming my ethernet card is lo0 : String[] command = { "/bin/sh", "-c", " ifconfig lo0 | grep -oP '[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}'" }; Process child  ...
Java getting my IP address - Stack Overflow
https://stackoverflow.com/questions/8083479/java-g ...
I am connecting to a server using the IP given by ifconfig inet addr, and I am looking to get the device's inet addr. I could check the IP of the socket on the server side, but thought it'd be nicer if the device (client) tells the server which ...
How to execute shell command in Java? - Stack Overflow
https://stackoverflow.com/questions/23322740/how-t ...
Not a very Stackoverflow friendly question, since I am not sure if you are asking about Shell command execution, or ipconfig in general. If the first is the case here : Yep, you can use Runtime.getRuntime.exec() . Related Answers (In ...
java Runtime.getRuntime().exec cannot get output for some ...
https://stackoverflow.com/questions/22999058/java- ...
So with the code below, I can read the output of Runtime.getRuntime().exec for some commands but not others. You will see that some commands return their output just fine like ls and ifconfig, but then trying to get openssl to ...
How can I get MAC Address without using the IP in Java? - Stack ...
https://stackoverflow.com/questions/43351663/how-c ...
You can use system command like below(if you on nix systems, if your os is windows use ipconfig in a similar way): Runtime r = Runtime.getRuntime(); Process p = r.exec("ifconfig -u |grep ether"); p.waitFor(); BufferedReader b ...
get inet, bcast and mask from ifconfig - Stack Overflow
https://stackoverflow.com/questions/24033995/get-i ...
Im trying to get any and all inet, bcast and mask IPs from the ifconfig command in java. ... awk '{ print $1 }'"; String ifconfigCmd = "ifconfig"; System.out.println(" executing `" + ifconfigCmd + "`"); Process ifconfigProc = Runtime.
How to execute shell command in Java? - Stack Overflow
https://stackoverflow.com/questions/23322740/how-t ...
Not a very Stackoverflow friendly question, since I am not sure if you are asking about Shell command execution, or ipconfig in general. If the first is the case here : Yep, you can use Runtime.getRuntime.exec() . Related ...
Java Runtime.getRuntime().exec("ipconfig/release ... - Stack Overflow
https://stackoverflow.com/questions/29248123/java- ...
It works with a space. Process result = Runtime.getRuntime().exec("ipconfig / release");.
Extract network card address - Real's Java How-to
https://www.rgagnon.com/javadetails/java-0369.html
import java.util.*; public class ListNetsEx { public static void main(String args[]) throws SocketException { Enumeration nets = NetworkInterface. ... Otherwise, in NT/2K/XP, "ipconfig /all" will return all relevant network info for IP-bound adapters , including the MAC address (displayed as ... return false; return true; } private final static String winIpConfigCommand() throws IOException { Process p = Runtime.