Creating Jar with Intellij 2016 - No main manifest attribute

后端 未结 10 1874
清歌不尽
清歌不尽 2021-01-30 16:03

I am getting no main manifest attribute while running the jar create by Intellij. I extracted the jar and observed that there was another manifest

10条回答
  •  耶瑟儿~
    2021-01-30 16:53

    If using Maven, Ensure your pom.xml has the main class referenced and fully qualified, similar to:

            
                org.apache.maven.plugins
                maven-jar-plugin
                2.6
                
                    
                        
                            org.mypkg.MyMainClass
                        
                    
                
            
    

    (... of course the version number of the plugin may be different).

    The main class being not fully qualified, is what leads people to suggest moving the manifest to another location (in order to satisfy the reference locally).

提交回复
热议问题