How do I resolve ClassNotFoundException?

前端 未结 22 1456
后悔当初
后悔当初 2020-11-21 06:06

I am trying to run a Java application, but getting this error:

java.lang.ClassNotFoundException:

After the colon comes the location of the cla

22条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2020-11-21 06:41

    If you use maven, check that you have this plugin in your pom.xml:

        
            
    
                
                    org.apache.maven.plugins
                    maven-shade-plugin
                    3.2.0
                    
                        
                        
                            package
                            
                                shade
                            
                        
                    
                
    
            
        
    

    It will put your dependency (the exception reason) to your jar.

    FYI: this will include all dependencies inflated in the final jar

提交回复
热议问题