2011-05-18 50 views
-3
//import org.rosuda.REngine.REXP; 
//import org.rosuda.REngine.Rserve.RConnection; 
public class RConnectionFromJava { 

    public static void main(String args[]) 
    { 
    try{ 

     System.out.println("INFO: Trying to connect to R "); 
     RConnection c = new RConnection(); 
     System.out.println("INFO: Connected to R "); 
     System.out.println("INFO: The Server version is "+ c.getServerVersion()); 

     c.close(); 
    } 
    catch(Exception e) 
    { 
     System.out.println("ERROR: In Connection to R "); 
     System.out.println("The Exception is "+ e.getMessage()); 
     e.printStackTrace(); 
    } 
    } 
} 

這給RConnection一個錯誤。你能告訴我爲什麼會出現這個錯誤嗎?我的RConnection產生一個錯誤

+2

請提供更具描述性的問題標題。 – Nick 2011-05-18 07:09:03

+1

...併發布錯誤。 – Mat 2011-05-18 07:10:21

+0

對於編輯:請不要刪除或更改代碼段,即使您認爲它們是不必要的。這會使答案很難理解,並可能掩蓋真正的問題。 – 2011-05-18 11:22:20

回答

1

刪除//之前import org.rosuda.REngine.Rserve.RConnection;