Issue using Runtime.exec() in Vista

I've coded a simple method using Runtime.exec() to get the client MAC ID , and it worked alright on XP. Now my client want to switch to vista , and the method is not working. Here's my code
import java.io.*;
import java.util.regex.*;
public class GetMac
     public static String getMacAddress()
          String mac="";
          System.out.println("getMacAddress");
          try {
               RunTimeExecutor re=new RunTimeExecutor("ipconfig /all");
                mac=re.executeAndReturnMac();
                re.destroy();
          } catch (Exception e) {
               e.printStackTrace();
          return mac;
import java.io.IOException;
import java.io.InputStream;
* @author amal
public class RunTimeExecutor
          String cmd;
          Process proc;
           * @param cmd
          public RunTimeExecutor(String cmd)
                    this.cmd=cmd;
           * @return boolean
           * @throws WIException
          public  String executeAndReturnMac() throws Exception
               System.out.println("run");
               String mac="";
                    if(cmd==null)
                              throw new Exception("No Commands");
                    try
                          final Runtime rt = Runtime.getRuntime();
                          proc = rt.exec(cmd);
                          final StreamGobbler errorGobbler = new StreamGobbler(proc.getErrorStream());
                          InputStream iis=proc.getInputStream();
                          final StreamGobbler outputGobbler = new StreamGobbler(iis);
                          errorGobbler.start();
                          outputGobbler.start();
                          int exit=proc.waitFor();
                          System.out.println("exitVAl "+exit);
                          if(exit==0)
                               mac=outputGobbler.MAC;
                          return (exit==0) ? mac :null;
                catch (IOException e)
                          e.printStackTrace();
                catch (InterruptedException e)
                          e.printStackTrace();
                catch(Exception e)
                     e.printStackTrace();
                return null;
          public void destroy()
                    if(proc!=null )
                              proc.destroy();
* @author amal
import java.io.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
* @author amal
public class StreamGobbler extends Thread
    InputStream is;
    OutputStream os;
    public String MAC;
    StreamGobbler(InputStream is)
        this(is,null);
    StreamGobbler(InputStream is,OutputStream redirectTo)
        this.is = is;
        this.os = redirectTo;
     * @see java.lang.Thread#run()
    public void run()
        try
            PrintWriter pw = null;
            if (os != null)
                pw = new PrintWriter(os);
            InputStreamReader isr = new InputStreamReader(is);
            int c=0;
            BufferedReader br = new BufferedReader(isr);
            String line=null;
System.out.println("Start Reading");
                 while ( (line = br.readLine()) != null)
                      System.out.println(line);
                     if (pw != null)
                         pw.println(line);
                     Pattern p = Pattern.compile(".*Physical Address.*: (.*)");
                        Matcher m = p.matcher(line);
                        if (m.matches())
                             MAC = m.group(1);
                             System.out.println("seting MAC to "+MAC);
                             break;
            if (pw != null)
                pw.flush();
        } catch (Exception e)
            e.printStackTrace(); 
}The inputStream of the process doesnt get printed at all , the loop condition in StreamGobbler 'while ( (line = br.readLine()) != null)
' is never true.
Also , in random cases i've seen the System.out.println("exitVAl "+exit); line executing before the System.out.println("Start Reading"); line , and i though proc.waitFor() would guarentee otherwise.

thx guys for ur replies . The issue was because of some browser security system ( or so they said . ).However i'm still puzzled about the 'waiting for the stream to finish' part .
paul.miner wrote:
{I think the process is allowed to end with output still in the >>buffers, ..so this would be expected. You should be waiting for >>your .streams to finish, since that's what you really >>care .about. .Also, .you need to add synchronization between your >>threads so you can accurately retrieve "MAC". Also, do not break out >>of the loop when you find what you're looking for, you should >>continue .reading until the end of the stream.Wasn't I suppose to be reading out of the stream to prevent an overflow?Also the break is done there are multiple lines like 'Physical address .....: xxxxxxxxxx ' in the output , and the macid is the first one.About the ProcessBuilder , I'll look into it . Thx for your advice.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • Issue using Runtime.exec() to export a DB

    hi ,
    i'm trying to write a piece of code to export an oracle DB using Runtime.exec(). I searched the forums and came up a with a piece of code , modified it a bit .The issue is the system sometimes hangs while executing the code , it's like the proc.waitFor() never returns. However the execution is error-free if using a command like 'shutdown' instead of 'exp' .
    this is my main
    public class DBExporter
               * @param args
              public static void main(String[] args)
                        try
                                  StreamReaderThread outReaderThread = new StreamReaderThread();
                                  StreamReaderThread errReaderThread = new StreamReaderThread();
                                  //StreamReaderThread ww = new StreamReaderThread();
                                  Runtime rt = Runtime.getRuntime();
                                  outReaderThread.start();
                                  errReaderThread.start();
                                  String command = "exp beta/beta@frsp_dbS file=\"c:/shop.dmp\" full=\"N\" ";
                                  //command = "shutdown -s";
                                  Process proc = rt.exec(command);
                                  outReaderThread.setInputStream(proc.getInputStream());
                                  errReaderThread.setInputStream(proc.getErrorStream());
                                  //ww.setOutputStream(proc.getOutputStream());
                                  System.out.println(proc.waitFor());
                                  proc.getInputStream().close();
                                  proc.getErrorStream().close();
                                  proc.getOutputStream().close();
                        catch (Exception e)
                                  e.printStackTrace();
         }and this is the reader class
    import java.io.BufferedWriter;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.OutputStream;
    import java.io.OutputStreamWriter;
    *@deprecated
    public class StreamReaderThread extends Thread
         private BufferedReader     br;
         private BufferedWriter     bw;
         private StringBuffer     sb;
         private String               newline;
         private String               line;
         public StreamReaderThread()
              br = null;
              sb = null;
              newline = null;
              line = null;
         public synchronized String getText()
              if( sb == null )
                   return "";
              return sb.toString();
         private boolean     flag     = false;
         public synchronized void setInputStream( InputStream is )
              br = new BufferedReader(new InputStreamReader(is));
              flag = true;
         public synchronized void setOutputStream( OutputStream is )
                   bw = new BufferedWriter(new OutputStreamWriter(is));
                   flag = true;
         public synchronized void run()
              int i = 0;
              try
                   while( !flag )
                        wait();
                   flag = false;
                   while( (line = br.readLine()) != null )
                        try
                             if( sb == null )
                                  sb = new StringBuffer();
                                  newline = System.getProperty("line.separator");
                             else
                                  sb.append(newline);
                             sb.append(line);
                        catch( Exception e )
                             e.printStackTrace();
                        i++;
                        if( br == null )
                             break;
              catch( IOException ex )
                   ex.printStackTrace();
              catch( InterruptedException ex )
                   ex.printStackTrace();
    }

    Looks like a bug in StreamReaderThread. I can't see that it ever exits the wait() call since no one is calling notify or notify all.
    Kaj

  • Using runtime.exec to zip some files

    Hi,
    I am using runtime.exec to try to automatically zip a bunch of files on a server. However, it does not seem to be working.
    Before I execute the command, I save the zip command in a string. I then print the string to a log file, and then execute the runtime zip command. But nothing happens.
    Yet, when I copy the string from the log, and paste it in a terminal, it properly creates the zip files. So, I know I have the correct command string, it just does not seem to be working within the java application. Also, the command string uses fully qualified directories, so it is not a directory issue.
    I am using ubuntu linux.
    Any ideas?
    -Adam

    adamSpline wrote:
    Hi,
    I am using runtime.exec to try to automatically zip a bunch of files on a server. However, it does not seem to be working.
    Before I execute the command, I save the zip command in a string. I then print the string to a log file, and then execute the runtime zip command. But nothing happens. Within Runtime.exec() any command does not run in a shell and I bet you use wild cards and/or other commands to be interpreted by a shell which will not be interpreted since there is no shell. And, since you don't mention error messages or the return code, I will also bet you don't process the Process stdout , stderr and the return code properly.
    It looks to me like you have fallen for at least two for the traps in [http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html|http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html].
    >
    Yet, when I copy the string from the log, and paste it in a terminal, it properly creates the zip files. So, I know I have the correct command string, it just does not seem to be working within the java application. Also, the command string uses fully qualified directories, so it is not a directory issue.
    I am using ubuntu linux.
    Any ideas?I agree with 'masijade' - use the built in Java classes.
    >
    -Adam

  • How to capture output of java files using Runtime.exec

    Hi guys,
    I'm trying to capture output of java files using Runtime.exec but I don't know how. I keep receiving error message "java.lang.NoClassDefFoundError:" but I don't know how to :(
    import java.io.*;
    public class CmdExec {
      public CmdExec() {
      public static void main(String argv[]){
         try {
         String line;
         Runtime rt = Runtime.getRuntime();
         String[] cmd = new String[2];
         cmd[0] = "javac";
         cmd[1] = "I:\\My Documents\\My file\\CSM\\CSM00\\SmartQ\\src\\E.java";
         Process proc = rt.exec(cmd);
         cmd = new String[2];
         cmd[0] = "javac";
         cmd[1] = "I:\\My Documents\\My file\\CSM\\CSM00\\SmartQ\\src\\E";
         proc = rt.exec(cmd);
         //BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream()));
         BufferedReader input = new BufferedReader(new InputStreamReader(proc.getErrorStream()));
         while ((line = input.readLine()) != null) {
            System.out.println(line);
         input.close();
        catch (Exception err) {
         err.printStackTrace();
    public class E {
        public static void main(String[] args) {
            System.out.println("hello world!!!!");
    }Please help :)

    Javapedia: Classpath
    How Classes are Found
    Setting the class path (Windows)
    Setting the class path (Solaris/Linux)
    Understanding the Java ClassLoader
    java -cp .;<any other directories or jars> YourClassNameYou get a NoClassDefFoundError message because the JVM (Java Virtual Machine) can't find your class. The way to remedy this is to ensure that your class is included in the classpath. The example assumes that you are in the same directory as the class you're trying to run.
    javac -classpath .;<any additional jar files or directories> YourClassName.javaYou get a "cannot resolve symbol" message because the compiler can't find your class. The way to remedy this is to ensure that your class is included in the classpath. The example assumes that you are in the same directory as the class you're trying to run.

  • Parameter  to shell script using Runtime.exec(string)

    Hi all, ( Speciall hi to dheeraj tak )
    Briefly : How do i pass an arguement to a non - java executible being called using Runtime.exec.
    In detail : i am using Runtime.exec to call a shell script : The code is as follows:
    String callAndArgs[] = {"/home/tom/jakarta-tomcat-4.1.24/webapps/dash/script.sh"};
    try {
    Runtime rt = Runtime.getRuntime();
    Process child = rt.exec(callAndArgs);
    This works properly & calls the shell script which in turn invokes some other executible (c file).
    $HOME/midi/test/build/bin/<C-EXECUTIBLE>
    Here i am specifying the name (say hello.exe ) . So far so good.
    I want to make this happen dynamiclaly. so i need to pass the name of the executible as a parameter to the script.
    To pass a parameter i hav to change the string to :-
    String callAndArgs[] = {"/home/tom/jakarta-tomcat-4.1.24/webapps/dash/script.sh <C-EXECUTIBLE HERE>"};
    and the script to
    $HOME/midi/test/build/bin/$1 --- where $1 refers to argument 1. (C-EXECUTIBLE AGAIN).
    This is giving an IO - Execption. Plz help
    Code will be very helpful.
    Thanx in advance

    some 1 plz tell me the difference :-
    This is the documentation of Runtime.exec that i found :-
    1> exec
    public Process exec(String command) throws IOException
    Executes the specified string command in a separate process.
    The command argument is parsed into tokens and then executed as a command in a separate process. This method has exactly the same effect as exec(command, null).
    Parameters:
    command - a specified system command
    Complete refernce says : Process (String progName) ----- Executes a program specified by programname as a seperate process.
    2> exec
    public Process exec(String cmdarray[]) throws IOException
    Executes the specified command and arguments in a separate process.
    The command specified by the tokens in cmdarray is executed as a command in a separate process. This has exactly the same effect as exec(cmdarray, null).
    Parameters:
    cmdarray - array containing the command to call and its arguments.
    Complete reference says : Process exec(String comLineArray[]) ---- Executes the command line specified bythe string in comLineArray as a seperate process.
    This means that there is provision 4 command line arguments...
    how do u use it then????????????????????????????

  • How to run db2 command by using Runtime exec

    Hello
    I am using java. When i am runing db2 command by using Runtime.exec( String cmd, String[] env ). I gave the environment path
    DB2CLP=6259901
    DB2DRIVER=D:\ibm\db2\java\db2java.zip
    DB2HOME=D:\ibm\db2
    DB2INSTANCE=DB2
    DB2MMTOP=D:\CMBISS
    but still I am getting error message
    "DB21061E Command line environment not initialized"
    after setting the above path in the cmd It is working fine. When i am trying thro java programm i am getting the above error. Can I get answer for this.
    bhaski.

    Before you can execute DB2 commands you have to open a DB2 CLP. The following code will do so:
    import java.io.IOException;
    public class Db2 {
         public static void main(String args[]) {
              try {
                   Runtime rt = Runtime.getRuntime();
                   Process child = rt.exec("db2cmd");
                   child.waitFor();
              catch (IOException io) {
                   io.printStackTrace();
              catch (InterruptedException e) {
                   e.printStackTrace();

  • Can we run a java application using Runtime.exec()?

    Can we run a java application using Runtime.exec()?
    If yes what should i use "java" or "javaw", and which way?
    r.exec("java","xyz.class");

    The best way to run the java application would be to dynamiically load it within the same JVM. Look thru the class "ClassLoader" and the "Class", "Method" etc...clases.
    The problem with exec is that it starts another JVM and moreover you dont have the interface where you can throw the Output directly.(indirectly it can be done by openong InputStreams bala blah............). I found this convenient. I am attaching part of my code for easy refernce.
    HIH
    ClassLoader cl = null;
    Class c = null;
    Class cArr[] ;
    Method md = null;
    Object mArr[];
    cl = ClassLoader.getSystemClassLoader();
    try{
         c = cl.loadClass(progName.substring(0,progName.indexOf(".class")) );
    } catch(ClassNotFoundException e) {
    System.out.println(e);
         cArr = new Class[1] ;
         try{
         cArr[0] = Class.forName("java.lang.Object");
         } catch(ClassNotFoundException e) {
         System.out.println(e);
         mArr = new Object[1];
         try{
         md = c.getMethod("processPkt", cArr);
         } catch(NoSuchMethodException e) {
         System.out.println(e);
         } catch(SecurityException e) {
         System.out.println(e);
    try {            
    processedPkt = md.invoke( null, mArr) ;
    } catch(IllegalAccessException e) {
              System.out.println(e);
    } catch(IllegalArgumentException e) {
              System.out.println(e);
    }catch(InvocationTargetException e) {
              System.out.println(e);
    }catch(NullPointerException e) {
              System.out.println(e);
    }catch(ExceptionInInitializerError e) {
              System.out.println(e);
    }

  • Trying to run external script using Runtime.exec

    Hey,
    I am trying to use Runtime.exec(cmd, evnp, dir) to execute a fortran program and get back its output, however it seems to always be hanging. Here is my code snippet :
                Process process = Runtime.getRuntime().exec(
                      "./fortranCodeName > inputFile.txt" , null, new File("/home/myRunDir/"));
                InputStream stream = new InputStream(process.getInputStream());
                InputStream error = new InputStreamr(process.getErrorStream());
                BufferedReader stdoutReader = new BufferedReader(new InputStreamReader(stream));
                BufferedReader erroutReader = new BufferedReader(new InputStreamReader(error));
                System.out.println(stream.available());  //returns 0
                System.out.println(error.available());     //returns 0
                while (true) {
                    String line1 = stdoutReader.readLine();  //hangs here
                    String line2 = erroutReader.readLine();
                    if (line1 == null) {
                        break;
                    System.out.println(line1);
                    System.out.println(line2);
                }I know for a fact that this fortran code prints out stuff when run it in terminal, but I don't know if I have even set up my Runtime.exec statement properly. I think I am clearing out my error and input streams with the whole reader.readLine bit I have above, but I am not sure. If you replace the command with something like "echo helloWorld" or "pwd", it prints out everything properly. I also am fairly confident that I have no environmental variables that are used in the fortran code, as I received it from another computer and haven't set up any in my bash profile.
    Any Ideas?

    Okay, so I implemented the changes from that website (thanks by the way for that link, it helps me understand this a little better). However, my problem is still occuring. Here is my new code:
                class StreamThread extends Thread {
                InputStream is;
                String type;
                StreamThread(InputStream is, String type)
                    this.is = is;
                    this.type = type;
                public void run()
                    try
                        InputStreamReader isr = new InputStreamReader(is); //never gets called
                        BufferedReader br = new BufferedReader(isr);
                        String line=null;
                        while ( (line = br.readLine()) != null)
                            System.out.println(type  +">"+  line);
                        } catch (IOException ioe)
                            ioe.printStackTrace();
            try {
                Process process = Runtime.getRuntime().exec(
                      "./fortranCodeName" , null, new File("/home/myRunDir/"));
                StreamThread stream = new StreamThread(process.getInputStream(), "OUTPUT");
                StreamThread errorStream = new StreamThread(process.getInputStream(), "ERROR");
                stream.start();
                errorStream.start();
                int exitVal = process.waitFor(); //hangs here
                System.out.println("ExitValue: " + exitVal);

  • Using runtime.exec,process streams

    Hi all,
    I am using runtime.exec to execute a batch file(rmdir /s/q directoryname) which deletes all the files in a certain directory(including subdirectories). However, some of the files are not deleted since they are being used by other processes.
    I have closed all file references but still the batch file says they are being used by other processes. The File.canWrite() method however, returns true for all the files. I have also tried to delete the files using file.delete but it does not work.
    So I have 2 questions.
    1. Can I forcibly delete these files some other way.
    2. If i call a batch file to delete the files and it fails on some files, the command window displays "cannot delete files". How can I write out thse messages into a text file which i can use as a log file.Do I have to use Process.getInputstream()/Process.getInputstream() ? If so, how?
    Thanks for your help.
    Vinny

    I tried the following before but the string i get is always empty, but i can see there are messages in the command window. Please let me now if i am doing something wrong.
    try{
    Process p = rt.exec("cmd.exe /c start deletefiles.bat");
    InputStream ins = p.getInputStream();
    byte[] bytearray = new byte[1024];
    int bytecount;
    String dos_string="";
    BufferedInputStream bis = new BufferedInputStream(ins);
    while ((bytecount = bis.read(bytearray, 0, 1024)) > -1) {
    String str = new String(bytearray,0,bytecount);
    dos_string += str;
    System.out.println("dos string is" +dos_string);
    catch (Exception e) {
    System.out.println("Error: " + e);

  • Using Runtime.exec to execute a C++ executable

    Hello,
    I would like to know if it possible to execute a C++ executable using Runtime.exec() and wait for it to complete and how do I read back the output file created by the C++ executable into the Java Code?
    TIA.
    RHP

    When I execute the code with Runtime.exec(), and read
    from the Process's inputStream I am ablt to view the
    cout from the C++ code. But the output file that has
    to be created by the C++ code is not created,Then this is maybe an error in the C++ code? Maybe you don't have permissions to create that file where you want to.
    where
    would the output from the C++ code go to when I use a
    ofstream in my C++ code andIf you create the file stream in C++ with an absolute file name then the output goes into that file. If it's a relative file name, then the basis is most likely the current working directory (found in the system property "user.dir" if you used one of Runtime's methods without the File argument, otherwise it's the directory you provide.
    How do I read both streams
    from the Java Code?You create an FileInputStream and - if you want to read character instead of binary data - on top of that an InputStreamReader. You might add a BufferedReader on top of that if you want to read line by line.
    does that answer your questions?
    robert

  • Using Runtime exec() to open java on other directory

    HI, I have a little problem and i hope everyone can help me out abit. You see when u use Runtime.exec(), how to you use it so that when the file you want to open is different from your program directory.
    For example,
    my program is in c:\windows\desktop
    but the file i want to open eg. Somthing.class is in c:\my documents\
    How do I open it using java and i wish to open the file using the java command. Thank a million

    Runtime.getRuntime().exec("cmd /c start /d\"C:\\my documents\" java.exe Somthing");
    Can someone explain the /c start /d\"C:\Mydocuments\" java.exe Somthing.
    And I try to use ping in RunTime.exec,how do I construct the string?And how do i get the result of the ping?
    Thanks

  • How to copy .gif files from one dir to another using runtime.exec

    hello sir/madem,
    i want to copy some gif and jepg files from one directory to another dir using swing.
    when i tried with using runtime.exec(String[]) i am getting the following error.
    anybody please tell me what is the problem in my program
    java.io.IOException: CreateProcess: ren c:/windows/desktop/copy.java c:/windows/
    cc.java error=0
    code:
    public class copy
         public static void main(String[] args)
              try{
                   String s[]=new String[3];
                        s[0]="ren";
    s[1]="c:/windows/desktop/copy.java";
    s[2]="c:/windows/cc.java";
              Runtime rt=Runtime.getRuntime();
    Process p=rt.exec(s);
              int i=p.waitFor();
              System.out.println("i is "+i);
              }catch(Exception e){System.out.println(e);}
    please mail me to [email protected]
    thanks in advance
    samba reddy
    india

    why use the Runtime? There are methods for this in the IO package ...

  • Launching another VM instance using Runtime.exec()

    Hi,
    I have two separate Swing applications, say A and B. I need to launch B from A using Runtime.exec() - essentially I am launching another VM instance from one VM. I am encountering strange problems - B's main window comes up, but GUI doesn't update; sometimes B comes up and GUI updates, but huge memory leaks happen. All the problems with B go away once A is shut down. It almost looks like both the instances of VM are sharing (or competing for) the event thread. Any comments will be of great help. Thanks.
    note: There is no problem launching B if A is a console java application (i.e. no Swing GUI).

    I have recently had the same problem, especially with the part where it seems like the two applications are sharing or competing for the same event thread. Sometimes my application B hangs like it is stuck waiting for an event. Sometimes I can get it to unhang by moving the app window around or minimizing it. If it does break free, all the queued events occur in rapid succession. Anybody have any clue what's going on here? It's pretty annoying.

  • Opening a new browser using Runtime.exec()...

    I am trying to open a new IE browser window (from Windows) using Runtime.exec( ) command. The problem is that it uses the existing browser window instead of opening a new window. (opens a new window only if there isn't any other browser window)
    Here is the snippet of code that I am using to do this:
    String WIN_PATH = "rundll32";
    String WIN_FLAG = "url.dll,FileProtocolHandler";
    String url = "http://www.cnn.com";
    String cmd = WIN_PATH + " " + WIN_FLAG + " " + url;
    Process p = Runtime.getRuntime().exec(cmd);
    Thanks in advance.
    -Kishore

    >
    opening browser window seems to be easy task, >Even easier with [Desktop.browse(URI)|http://java.sun.com/javase/6/docs/api/java/awt/Desktop.html#browse(java.net.URI)].
    >
    ..can someone help me with closing browser window from java?>Which browser window?
    If you're app. opens a page that you control, it can be done from the web page. See [Have a Java button close the browser window|http://www.rgagnon.com/javadetails/java-0282.html] or the JS based [Close the browser|http://www.rgagnon.com/jsdetails/js-0079.html].
    If you do not control the page, don't close it - the user knows where the little 'x' button is.
    As an aside, despite being opposite ends of the one question, I do not consider this question to be 'part' of the current thread. I think you would have been better off starting a dedicated thread and explaining more fully what the use case is (and adding lots of Dukes).

  • How do I copy a file to a remote server using runtime exec - plz Help!

    Hi,
    I am trying to copy a file to a remote server using a runtime exec command as follows:
    Runtime.getRuntime().exec("scp "+getProperty(ListNewHandsetDetailsConstant.PROP_OUTPUT_PATH_JAR)+getProperty(ListNewHandsetDetailsConstant.PROP_OUTPUT_JAR_NAME)+".jar "+" "+getProperty(ListNewHandsetDetailsConstant.PROP_OUTPUT_PATH_TWO_USERNAME)+"@"+getProperty(ListNewHandsetDetailsConstant.PROP_OUTPUT_PATH_TWO_URL)+":"+getProperty(ListNewHandsetDetailsConstant.PROP_OUTPUT_PATH_TWO_JAR));
    Problem is this statement does not execute, as when I try it directly on command line, it requests for a password. Any suggestions on how I can get rid of that? I think I might have to configure my ssh_config file, but when I did some "Googling", I found the configuration settings of a ssh2_config file. I tried those (changing it to Host-based Authentication), but it didn't recognise them. Please help, this is so urgent!
    Regards,
    Simz

    Don't use Runtime.exec (or ProcessBuilder) for this. Check out JSch at JCraft (or some other Java SSH API.

Maybe you are looking for

  • General xSan questions for a new setup

    So I'm looking to setup xSan. Had mainly one question. I know it's recommended that you have a secondary metadata controller server incase one goes down, but is this absolutely needed? We will have very few (like 3) people using the system so it won'

  • How do I know if the security update is really from Firefox?

    I just had a screen shot advising me of a 'Security Update' and I was strongly advised to install it. It offered a webpage for further investigation and an 'Install' button ... I was busy, doing several things at once and by mistake I clicked 'Instal

  • OpenStack Israel 2015 - The Road to The Enterprise

    cloudnewsday.com - Today's top 4 posts on b j srinath, organisations, smac, isaca. BENGALURU:As more and more organisations adopt technologies such as the internet of things and cloud computing, they will have to fac... Tweeted by @cloudnewsday https

  • Questions in iRec

    Team, We are implementing iRec now and want to do approvals based on Hiring manager instead of standard recruiter's manager. We are trying to do that in AME. We know that we need to feed in a dynamic sql query to fetch the hiring manager info. And we

  • Calling a Table type with a specified value.

    Hi Everyone, Please do have a look at this and help me understand. Inside a procedure I found a table type         TYPE r_rates IS RECORD(         low_rate       growth_rates.low_growth%TYPE  DEFAULT 0        ,mid_rate       growth_rates.mid_growth%T