csta
csta

Reputation: 2553

Compiling with EJML.jar file

I'm working on a macbook pro

I'm very new to java and it looks like I'm going to have to learn it quick. Help would be much appreciated.

I download ejml-0.17-src.zip file, followed the instructions, and ended up with what I believe is the correct jar file,

 EJML.jar

I found a hello world-ish example from the ejml website. Since the example was just a main() function, I put the example in

import EJML.*;

public class MatrixTest{
    main(String[] args){
    ...
    }
}

and I'm now trying to compile it and then run it.

When I try to compile it I make sure that I'm in the directory with the EJML.jar file and I've tried

java MatrixTest.java
javac MatrixTest.java
java -classpath EJML.jar MatrixTest.java 
javac -classpath EJML.jar MatrixTest.java 
javac cp EJML.jar MatrixTest.java
java -cp EJML.jar MatrixTest.java

but none of these work. I'm sure this is a super-newbie question, but I'm a little tight on time. I humbly ask for your help, with maybe a few words of explanation.

This ended up working by learning to use the API doc and changing to,

import org.ejml.data.*;

compiling with

javac -classpath :EJML.jar MatrixTest.java

and running with,

java -classpath :EJML.jar MatrixTest

Thanks for all the help.

Upvotes: 2

Views: 2215

Answers (1)

Brad Mace
Brad Mace

Reputation: 27886

It would help if you defined "not working" and shared what the error message is if there is one, but for one thing your import is wrong. You don't import based on jar names, you import based on the packages and classes within.

You can see in the API docs that the base package is org.ejml.

Then when you use specific classes, you need to look at which package they're in. DenseMatrix64F is not in the base package, it's in org.ejml.data.

Upvotes: 1

Related Questions