I don't know how to add jxl.jar in android studio
I tried to pasts jxl.jar in lib project and using project structure
then tried to start to create WorkBook obj
but not working.
what I missed?
If you use gradle (Android Studio), then add in dependencies:
dependencies {
implementation 'net.sourceforge.jexcelapi:jxl:2.6.12'
}
Paste your jxl.jar into the libs folder
Right click it and select 'Add as library'
Make sure that compile files('libs/jxl.jar') is in your
build.gradle file (or compile fileTree(dir: 'libs', include: '*.jar')
if you are using many jar files) if it still not there then you can try to add it manually by adding this compile files('libs/jxl.jar') inside dependancies
Synch your project
Related
i found lot of FFT library on github but i don't know how to add them to my project.
I try to import it without success.
Can you help?
Here what i found:
1) https://sites.google.com/site/piotrwendykier/software/jtransforms
2) https://github.com/wendykierp/JTransforms
If your project has a libs folder for external dependencies then you are good. Else create one under the main project. If you have the jar with all dependencies for the FFT algorithm, put it in the above mentioned libs folder. Next open build.gradle under app and add the following line under dependencies if it not already there..:
compile fileTree(dir: 'libs', include: ['*.jar'])
Sync the project as you usually do.
I am new to android studio and tried to import a project which someone else had made into it .The project has google play services jar file in its libs folder.I got the following error while importing:
Why does this error occour and how do i fix it?Will it be shown for other library files also?
This can happen when your external library or the dependencies are not added in the Android Studio Properly .
So what you can do is :
1.Put the jar file into the libs folder.
2.Right click it and hit 'Add as library'.
3.Ensure that compile files('libs/google-play-services_lib.jar') is in your build.gradle file and Finally add the dependencies.
Eg.
dependencies {
compile fileTree(dir: '../jar', include: '*.jar')
compile project(':pull-to-refresh')
compile files('libraries/abcdef.jar')
compile files('libraries/google-play-services_lib.jar')
}
Hope this helps :)
With Gooole Play Services - you don't have to even copy library from old project to new one. You can get it is easily by adding in build.gradle in dependecies section:
compile 'com.google.android.gms:play-services:5.0.89'
(or any other version, that will be suitable for you) and lib will be automatically downloaded/added
I have an Android project with an Android application that depends on a pure Java library (and the Java library uses some others compiled jars libraries). I added the dependencies, I can build the project, but at run time I have a ClassNotFoundException error.I had to add to theCLASSPATHenvironment variable the path to the jars.Is there a way to set the classpath locally for the project only, like using the command line option
java –classpath <path to the jars>
in the Android studio Run/Debug Configurations?
First off all, be sure there's a "libs" subfolder in the "app" folder of your project. If there's not, create one.
Next, in the app/build.gradle file, add this line of code:
dependencies {
...
compile fileTree(dir:'libs', include: ['*.jar'])
...
}
Place all of your .jar files in the "libs" folder, and voila, you're done
Thanks to Arnold Layne, I created a folder named libs.
Then, I went to
Files -> Project Structure (new menu opens) -> Modules (on the left) -> app -> Dependencies
There, I could add the library with the + Button.
This created this entry:
dependencies {
implementation files('libs/commons-lang3-3.7.jar')
}
Add this lines to build.gradle of app module.
dependencies {
...
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation files('libs/mysql-connector-java-8.0.16')
...
}
I just downloaded the file jdom-2.0.5.zip so I can make my apps manipulate xml files, the thing is, I don't know where to place it or how to install it.
You can unzip the "zip" file and move it to the "libs" folder the jar file of your project in Android Studio.
Check if you have in your gradle this code line:
compile fileTree(dir: 'libs', include: ['*.jar'])
I'm trying to add org.apache.commons.lang3 to my build. I've downloaded the library which is directory containing jar files.
My group is using gradle to build the project, and I know just enough to maybe ask the right question. So what I think the build is doing is
copying a bunch of .bnds to the build directory
compiles the java we have in src/main/java (via source sourceSets.main.java.srcDirs?)
I would like to add the lang3 library, but I'm not sure how to go about doing that. Can I just dump it into src/main/java? Or do I have to tell gradle about it?
This is what I think is relevant from the current build.gradle
ext.releaseDir = "${buildDir}/release/${tpVersion.getProgramName()}"
ext.bundlesDir = "${releaseDir}/nucleus/bin/nucleus_java/bundles/"
dependencies {
compile fileTree(dir: bundlesDir, include: '*.jar')
bnd {
source sourceSets.main.java.srcDirs
include '**/*.bnd'
You could declare it as a dependency, if it exists in any remote repository. That's the way I would do it.
But if you want to use the local file, do not put it in src/main. Use an extra folder called lib or similar on the same directory level as src or you build script.
Then you can add the local dependency to the build.gradle as in this sample:
repositories {
//central maven repo
mavenCentral()
}
dependencies {
//local file
compile files('libs/toxiclibscore.jar')
//dependencies from a remote repository
compile 'java3d:vecmath:1.3.1', 'commons-lang:commons-lang:2.6'
}
The simplest way is to use maven repository for accessing dependencies.
You can also access this jar directly from filesystem with file dependencies.
dependencies {
compile files('libs/a.jar', 'libs/b.jar')
compile fileTree(dir: 'libs', include: '*.jar')
}