We are trying to run a gradle spark jar on Ubuntu which was built on Mac.The jar runs fine on Mac but in Ubuntu it gives “Cannot load or find Main class.Kindly help resolving the issue”.
Is there anything specific to be mentioned in build.gradle file or its JDK path issue, please suggest
project(":spark"){
dependencies{
compileOnly group: "org.apache.spark", name: "spark-mllib_${scala_version}", version: "${spark_version}"
}
task fatJar(type: Jar) {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
zip64 true
manifest {
attributes 'Main-Class': "com.abc.launcher.HelloWorld"
}
archiveBaseName = "HelloWorld"
from { configurations.compileClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}