Thanks to some excellent help on another question, I am happily building Java applications on my Windows 7 machine. However, I am hoping to use the statistical package R and would like to call it from Java.
I have installed R, I have installed a package for R called JRI. It comes with some java test files and they don't run. I think my problem might be knowing how to import packages other than those that come with the JRE.
I just set path to get Java to run.
in my path let's me run javac x.java and java x just fine.
I also have R in my path
and it runs just fine using the Rterm command.
JRI is installed as part of rJava in the R directory tree. I see these files, which seem to be what I want,
so I added
to the path. This is where these files were installed.
Then I try to run their test program-
I get errors compiling it. There are 30 of them and mostly they are "can't find symbol." But the ones that I think actually matter are-
"package org.rosuda.JRI does not exist."
So... I think there is just something simple I don't understand about Java. Could someone set me straight?
Of course, I'd love to know what the best package is for running R from Java, JRI is the only one I found. Or if there are any Java/R experts that would like to point me to a good tutorial, that would also be great!
I think you are confusing between path and classpath. Path is what you need to add in order for your shell (or dos prompt) to find the executable file. Classpath is the java equivalent. It is the path that the JVM must search in order to find the classes. So if you have jars, you might want to add the jars to the classpath.
http://download.oracle.com/javase/tutorial/java/package/managingfiles.html This is one tutorial. Though you might be able to find simpler tutorials online on setting classpaths.
PS: Make sure that the jar file is in teh classpath, not just the directory it is in