Reputation: 93
I'm working on a kotlin project that I want to execute as a jar. This is all done in IntelliJ Idea and I went about making the jar using the artifacts.
The process I followed was (as illustrated by an Idea guide):
After this, I get a
'no main manifest attribute, in ____.jar'
What I have tried after reading several stack overflow questions:
All of the above has not worked.
Something that is confusing to me is that, even when I alter the manifest file to be in "incorrect" format, it still gives the same error. The path stated in the artifact's details is correct yet there is no difference even when I purposely input incorrect items in the manifest file. Not sure if that is the"real" problem but I'm also not sure how to fix that as well
Upvotes: 6
Views: 11634
Reputation: 70
None of the solutions worked for me.
I solved it in this way:
When setting up the artifact, change:
Meta-inf: (...)\src\main\
(you must remove "java")
Also, there was a problem with resources, solved this way:
When setting up the artifact:
Output Layout > Add copy of > Directory content > resources.
That's all!
Upvotes: 4
Reputation: 1
while creating the exeutable jar file explicitly create a mainfest.txt file that should be in order of the directory structure and mainfest.txt file should contain only one line (Main-Class:name of the class containg main method)then run the jar tool
Upvotes: 0
Reputation: 93
For anyone that may have encountered this problem in intellij and did not find a solution in any other posts, what helped me was
The end result looked like this
Upvotes: 3