IntelliJ does not apply Main class property

Answered

Intellij always adds wrong main class "org.apache.commons.compress.archivers.Lister" in MANIFEST.MF inside jar file, even I DID applied correct main class "com.googlecode.dex2jar.tools.BlackObfuscatorCmd" in Artifacts. BlackObfuscator\dex-tools\src\main\resources\META-INF\MANIFEST.MF contains

Manifest-Version: 1.0
Main-Class: com.googlecode.dex2jar.tools.BlackObfuscatorCmd

I tried invalidating cache, rebuilding project, resync gradle etc, but nothing helps. 

What I'm missing? Please check my project Upload id: 2022_09_15_Qc5YvhT9Q3F8DNrRsPoKfU (file: BlackObfuscator.zip)

2 comments
Comment actions Permalink

None of the solutions helps, but I noticed a person posted a screenshot containing META-INF folder inside artifacts which gave me a hint. IntelliJ does not create META-INF in the root folder, thus causing strange issue. After messing around, it finally create META-INF in the root folder. I think I must select one of module instead All modules in "creating JAR from Module" dialog in order to create META-INF. Strange

Now it adds correct META-INF with correct Main class when building JAR

0

Please sign in to leave a comment.