Reputation: 121
I believe this might be a silly question but I'm trying to use a jar file within my app and cannot find how to import it. I have successfully added the jar to my library:
I now just need to put it to use through the code. Is there an import
statement that should have come with the file? As I cannot seem to find it
Upvotes: 1
Views: 42
Reputation: 191681
Is there an import statement that should have come with the file?
In the Java code? Yes. For example: where you copied the code from
I'm trying to use a jar file within my app
Open build.gradle
, look for compile fileTree
line within dependencies
block
You don't need to do anything if that line is there as it says "grab all JAR files in the libs/
directory".
Ideally, though, you don't want a JAR file.
dependencies {
...
// Add this line
compile group: 'edu.emory.mathcs', name: 'JTransforms', version: '2.4'
}
Upvotes: 1