0

I am trying to run my Spark Job using IntelliJ and it ran successfully while working without jar.
Now I am trying to build a jar to run it in some other environment.
After creating the Jar I try to run it and had encountered an error:

/usr/lib/jvm/java-8-openjdk-amd64/bin/java -Dfile.encoding=UTF-8 -jar /home/aims/workspace/second/target/second-1.0-SNAPSHOT.jar local[*] thrift://localhost:9083
no main manifest attribute, in /home/aims/workspace/second/target/second-1.0-SNAPSHOT.jar

Process finished with exit code 1

I tried to change the META-INF to resources folder. Please check it as I have already gone through many suggestions on Stackoverflow related to this particular problem and not a single suggestion helped me. Hence, I am writing this question here. Following it the current location of META-INF

/home/aims/workspace/second/src/main/resources/META-INF

Kindly, let me know how I can run my job successfully using the jar?

Jaffer Wilson
  • 7,029
  • 10
  • 62
  • 139
  • See [this answer](http://stackoverflow.com/a/42200519/104891) for the sample working project with a jar, a dependency and a `MANIFEST.MF`. – CrazyCoder Feb 23 '17 at 15:09
  • @CrazyCoder Thank you but didn't worked for me. I tried and same error. – Jaffer Wilson Feb 23 '17 at 15:44
  • Share a project to reproduce, the sample project from the link definitely works. – CrazyCoder Feb 23 '17 at 15:45
  • @CrazyCoder Sure. You have Apache Spark? – Jaffer Wilson Feb 23 '17 at 15:46
  • @CrazyCoder Here is my project .. please check it: https://jumpshare.com/v/KtFyyh3gxlEUjVDmafPq – Jaffer Wilson Feb 23 '17 at 16:02
  • Sorry, but it's not a [Minimal, Complete, and Verifiable example](http://stackoverflow.com/help/mcve). `pom.xml` doesn't specify any dependencies, it doesn't build. I also doubt that it will work when all the spark jars are extracted into the single file since it may override manifests or other important classes and metadata. Try using the jar with linked dependencies vs extracted. – CrazyCoder Feb 23 '17 at 16:08
  • @CrazyCoder let try... – Jaffer Wilson Feb 23 '17 at 16:09

0 Answers0