to tentando descobrir o gateway numa maquina com windows com isso:
import java.io.*;
import java.util.*;
public class PegaIpo {
public static void main(String[] args) throws IOException {
Process result = Runtime.getRuntime().exec("netstat -rn");
BufferedReader output = new BufferedReader(new InputStreamReader(result.getInputStream()));
String thisLine = output.readLine();
StringTokenizer st = new StringTokenizer(thisLine);
st.nextToken();
String gateway = st.nextToken();
System.out.printf("Gateway: %s\n", gateway);
}
}
mas ta dando erro, dessa vez nem declarei as variaveis to ficando bom nisso!