title: Runtime.getRuntime().exec gets no results when used from java netbeans
body: <p>I am working on a Java project, and stuck at a step as it is showing no results.</p>
  
  <p>The java code is:</p>
  
  <pre><code>public class callPgs {
  
  public static void main(String[] args) {
      // TODO Auto-generated method stub
  
      try{    
          Process p = Runtime.getRuntime().exec("C:/R/R-3.2.0/bin/Rscript.exe C:/R/R-3.2.0/bin/arrayqualityMetrics.R");
  
          int processComplete = p.waitFor();
  
                     if (processComplete == 0) {
  
                          JOptionPane.showMessageDialog(null,"Process is completed");
                          System.out.println("successfull");
                     } else {
                         JOptionPane.showMessageDialog(null,"You Have selected Wrong Input File");
                          System.out.println("Could not complete");
                     }
                  }
                  catch (Exception e1)
                  {
                                 e1.printStackTrace();
                  }
      }
  </code></pre>
  
  <p>}</p>
  
  <p>as I am executing this by using command prompt using Rscript.exe</p>
  
  <p><code>C:\R\...\bin\Rscript "arrayqualityMetrics.R"</code></p>
  
  <p>I am getting my results correctly
  but when I am doing it by Java netbeans using the above code, it is showing else option as "Could not complete" in the netbean's console.</p>
  
  <p>As other RScripts are running good and without any error but this one is not giving the results, as the Rscript is for arrayqualityMetrics as:-</p>
  
  <p>library(arrayQualityMetrics)</p>
  
  <p>library(limma)</p>
  
  <p>library(tcltk)</p>
  
  <p>options( warn = -1 ) #commands for removing warnings as they are comming when running the Rscript from the R console.</p>
  
  <p>X &lt;-tk_choose.files(caption = "Choose Files")</p>
  
  <p>maData&lt;-read.maimages(X, source="agilent", other.columns = "gProcessedSignal", green.only=TRUE)</p>
  
  <p>eSet&lt;-new("ExpressionSet", exprs = maData$other$gProcessedSignal, annotation =maData$genes[,7])</p>
  
  <p>arrayQualityMetrics(eSet, outdir="QC_C", force = TRUE, do.logtransform = TRUE)</p>
  
  <p>So I want to ask weather there is any error in the Rscript or there is any thing I should add in the java code to run it properly....
  Any help is appreciable......</p>