We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › import issue
Page Index Toggle Pages: 1
import issue (Read 566 times)
import issue
Jul 4th, 2008, 3:27pm
 
Hi. I'm new to Processing. I would like to use a matrix computation package (mtj) within Processing, but on this instruction:

import no.uib.cipr.matrix.BandMatrix;

it triggers the following exception:

/tmp/build38983.tmp/Temporary_5469_5682.java:1:57:1:85: Semantic Error: The import "no/uib/cipr/matrix/BandMatrix" is not valid, since it does not name a type in a package.

I have no problem using this library in a standard .java program, since the jar is in my classpath (/etc/environment => CLASSPATH="/home/jd/dev/java:/usr/share/java:/usr/share/java/mtj.jar:/usr/share/
java/jama.jar:/opt/colt/lib/colt.jar:/opt/colt/lib/concurrent.jar").

Must I add something specific for Processing, or copy/jink the lib in a Processing folder? I did not find the answer in the forum, sorry if the question seems stupid :)

Thank you.
Re: import issue
Reply #1 - Jul 5th, 2008, 5:08pm
 
what you're doing looks ok.

and it seems to be a problem with the jar rather than the classpath (am pretty certain you'd get a more basic error if it couldn't find the jar).

could it be using a different version of java? something like that?
Re: import issue
Reply #2 - Jul 5th, 2008, 7:03pm
 
Providing a simple link like Matrix Toolkits for Java (MTJ) would have saved a few minutes of search... Is that where you got it Looks like the Jar file on this site is made with Java 1.5 (and I think Java libraries are upward compatibles anyway), and you say it worked in plain Java anyway, so I don't think koogs' hypotheses are funded, alas.

I believe that you must create the mtj/library folders in the library directory of Processing, and put the jar file there.
When I did that, the error has disappeared.
I don't know if there is a less constraining way to do that in Processing... Putting the jar in a data folder in the sketch folder doesn't seem to work, alas.
Re: import issue
Reply #3 - Jul 7th, 2008, 10:52am
 
Hi. I eventually found a workaround: I put the jar in a code/ directory of my sketch. Thank you for your help!
Page Index Toggle Pages: 1