Initializing network configuration when invoking cmd prompt from RunTime.exec()
posted 6 years ago
I am building a swing application where in when we click a button I need to run a process from command prompt which needs network configuration information. I display the response from the process in a JTextArea. Currently the process is failing unable to resolve localhost. I tried to debug the problem and found out that network configuration is not initialized for the new command prompt which is invoked from Runtime.exec(). can some body tell how to initialize network configuration in this scenario.
Here is the code...... ResolveLocalHost is the java code where in I used InetAddress.getLocalHost() and I am printing the error in catch block.