Click here to Skip to main content
15,890,527 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hello team,

I am trying to find out arrayqualitymetrics from Java coding, but unable to do so, as my code is


C#
try{
        Process p = Runtime.getRuntime().exec("C:/R/R-3.2.0/Rscript.exe arrayqualitymetrics.R");

        int processComplete = p.waitFor();

           if (processComplete == 0) {
                System.out.println("successfull");
                JOptionPane.showMessageDialog(null,"Process is completed");
           } else {
                System.out.println("Could not complete");
                JOptionPane.showMessageDialog(null,"You have selected wrong input file");
           }
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }


here arrayqualitymetrics.R is the Rscript for finding results from microarray data
It is giving results from R programing but it is not giving result when called from this java code...
any help is appreciated

thank you
Posted
Updated 29-Jun-15 0:47am
v3
Comments
Sergey Alexandrovich Kryukov 27-Jun-15 13:56pm    
Probably you did not get any answers because you did not even try to explain what you are talking about.
You can expect that pretty soon your present question will be automatically removed, you already got two "Incomplete or not clear" reports.
—SA
Member 11708542 29-Jun-15 1:43am    
I have updated the question... Have a look at it... and help me out to solve the query.... :)
Richard MacCutchan 29-Jun-15 3:59am    
You need to explain exactly what results you see or what errors occur when you run this. Assuming the path to Rscript.exe is correct, are you sure that it is running in the correct directory to access the script file? You probably need to put the full path there as well.

BTW the title of your question has nothing to do with the issue you are facing. This is simply a question of using Java to run an external process.
Member 11708542 29-Jun-15 6:52am    
Richard, the path is defined in the Rscript and it is running good when I am using it through R programing and also it is running good when executed from command prompt, but when I am running it from java by using above commands, it simply jumping to else and showing "You have selected wrong input file" dialog box
Richard MacCutchan 29-Jun-15 9:32am    
But that does not guarantee it will get the correct path when being started from Java. Check again exactly what path the Rscript executable uses to access the data file.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900