I have this line in my code:
import org.apache.commons.lang.StringUtils;
I downloaded the Apache Commons Lang 2.6 zip from http://commons.apache.org/proper/commons-lang/download_lang.cgi
. There were two choices for Binaries, 1) commons-lang-2.6-bin.tar.gz
and 2) commons-lang-2.6-bin.zip
. I downloaded the second one and then extracted it. Then I went to the properties for my project and added the commons-lang-2.6 JAR file to my build path (there were two others - javadoc & sources). Then I go to my command prompt and try to do a gradle clean build
to see if I'll get a successful build and it says error: org.apache.commons.lang does not exist
. Any help to get rid of this error? I'm using myEclipse and it doesn't give me that error, only my cmd does.
If i understand correctly, you added the jar in your eclipse build path. However, this usually doesn't mean you added it to you gradle build script, which means gradle doesn't know about the commons-lang jar file, only eclipse does.
To add it to gradle, you should add it to the build.gradle file, more or less as follows :
dependencies {
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.3.2'
}
Maybe you could try using a gradle plugin for ecplise, like https://github.com/spring-projects/eclipse-integration-gradle/ to automate or make easier to keep ecplise and the gradle script in sync.