解决SpringBoot2.1.0 报错NoClassDefFoundError: XXX

不说废话:

1、检查idea maven setting配置及资源仓库配置,检查环境变量配置

点击file-settings-搜索maven

解决SpringBoot2.1.0 报错NoClassDefFoundError: XXX_第1张图片

观察你的mavenhome,settingfile,repository这三个地方是否是你期望的配置。

检查环境变量配置(虽说不知道会不会影响,但是我还是比较喜欢整齐划一的,不说别的检查一下)

解决SpringBoot2.1.0 报错NoClassDefFoundError: XXX_第2张图片

一看保持一致就好。如果不一致,请配置环境变量(地址用你自己的):

  • MAVEN_HOME    D:\Maven\apache-maven-3.5.3
  • Path                      %MAVEN_HOME%\bin

2、删掉maven资源库

如果可以的话,删除全部资源,重新下载。

3、修改maven仓库私服镜像地址



    
    
    
    
    
    D:/Maven/repository
    
    
        
            alimaven
            central
            aliyun maven
            http://maven.aliyun.com/nexus/content/repositories/central/
        
        
            alimaven
            aliyun maven
            http://maven.aliyun.com/nexus/content/groups/public/
            central
        
        
            central
            Maven Repository Switchboard
            http://repo1.maven.org/maven2/
            central
        
        
            repo2
            central
            Human Readable Name for this Mirror.
            http://repo2.maven.org/maven2/
        
        
            ibiblio
            central
            Human Readable Name for this Mirror.
            http://mirrors.ibiblio.org/pub/mirrors/maven2/
        
        
            jboss-public-repository-group
            central
            JBoss Public Repository Group
            http://repository.jboss.org/nexus/content/groups/public
        
        
            google-maven-central
            Google Maven Central
            https://maven-central.storage.googleapis.com
            
            central
        
        
            maven.net.cn
            oneof the central mirrors in china
            http://maven.net.cn/content/groups/public/
            central
        
    
    

4、重新下载maven依赖即可

由于用了国内镜像,很快很快的

5、不出意外,如下图所示 

解决SpringBoot2.1.0 报错NoClassDefFoundError: XXX_第3张图片

你可能感兴趣的:(java,报错总结)