• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Confused about setting PATHS in Windows 7

 
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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,

jri.dll
JRI.jar
JRIEngine.jar
REngine.jar

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!

 
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello
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
 
Jon Swanson
Ranch Hand
Posts: 265
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks. So I have the jar files in



so I do this in my DOS window



Same errors.

I was looking at-

Java Package Tutorial

which I thought gave a pretty clear explanation of CLASSPATH. So I am even more confused now, since the test program still claims it cannot find the package.

I tried jar -tvf JRI.jar, the results look right-

META-INF
META_INF/MANIFEST.MF
org/
org/rosuda/
org/rosuda/JRI/
org/rosuda/JRI/<bunch of classes>
jri.dll

all the imported classes appear to be in the JAR file.

Oh! I reread your e-mail and changed the CLASSPATH to



and it compiled. I misread the last line of the reference I mentioned above.

Thanks very much!

 
reply
    Bookmark Topic Watch Topic
  • New Topic