Can't execute jar- file: “no main manifest attribute”

后端 未结 30 1976
不知归路
不知归路 2020-11-21 22:30

I have installed an application, when I try to run it (it\'s an executable jar) nothing happens. When I run it from the commandline with:

java -jar \

30条回答
  •  旧时难觅i
    2020-11-21 22:56

    Alternatively, you can use maven-assembly-plugin, as shown in the below example:

    
        maven-assembly-plugin
        
          
            package
            
              single
            
          
        
        
          
            
              true
              com.package.MainClass
            
          
          
            jar-with-dependencies
          
        
       
    

    In this example all the dependency jars as specified in section will be automatically included in your single jar. Note that jar-with-dependencies should be literally put as, not to be replaced with the jar file names you want to include.

提交回复
热议问题