I just built a simple java project with this gradle file:
apply plugin: 'java'
allprojects {
sourceCompatibility = 1.7
targetCompatibility = 1.7
}
repositories {
mavenCentral()
}
dependencies {
compile 'org.jsoup:jsoup:1.8.3'
}
then, it generates:
build/java/classes/main
build/tmp
build/libs
build/dependency-cache
where build
is inside workspace
I then run java -cp build/classes/main MainSisgrad
and it works, but when it come to the part of the jsoup interpretation, I get:
Exception in thread "main" java.lang.NoClassDefFoundError: org/jsoup/Jsoup
Note that the folder build/libs has a file names workspace.jar, whats is it? Is it a .jar with all the libs compiled? Including jsoup? Because I tried to include it in the classpath like this:
java -cp build/libs/workspace.jar -cp build/classes/main MainSisgrad
or
java -cp build/libs/ -cp build/classes/main MainSisgrad
but it didn't work. What's missing?