• idea 使用sonarlint报错解决方案


    在idea使用sonarlint可能出现以下报错:

     1 Plugin 'org.sonarlint.idea' failed to initialize and will be disabled.  Please restart IntelliJ IDEA.
     2 com.intellij.diagnostic.PluginException: org/sonarlint/intellij/config/global/SonarLintGlobalSettings : Unsupported major.minor version 52.0 [Plugin: org.sonarlint.idea]
     3     at com.intellij.ide.plugins.cl.PluginClassLoader.b(PluginClassLoader.java:130)
     4     at com.intellij.ide.plugins.cl.PluginClassLoader.a(PluginClassLoader.java:77)
     5     at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:66)
     6     at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
     7     at java.lang.Class.forName0(Native Method)
     8     at java.lang.Class.forName(Class.java:249)
     9     at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentsRegistry.a(ComponentManagerImpl.java:427)
    10     at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentsRegistry.a(ComponentManagerImpl.java:417)
    11     at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentsRegistry.access$000(ComponentManagerImpl.java:403)
    12     at com.intellij.openapi.components.impl.ComponentManagerImpl.a(ComponentManagerImpl.java:108)
    13     at com.intellij.openapi.components.impl.ComponentManagerImpl.init(ComponentManagerImpl.java:87)
    14     at com.intellij.openapi.components.impl.stores.ApplicationStoreImpl.load(ApplicationStoreImpl.java:101)
    15     at com.intellij.openapi.application.impl.ApplicationImpl.load(ApplicationImpl.java:499)
    16     at com.intellij.openapi.application.impl.ApplicationImpl.load(ApplicationImpl.java:481)
    17     at com.intellij.idea.IdeaApplication.run(IdeaApplication.java:170)
    18     at com.intellij.idea.MainImpl$1$1$1.run(MainImpl.java:62)
    19     at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
    20     at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:715)
    21     at java.awt.EventQueue.access$400(EventQueue.java:82)
    22     at java.awt.EventQueue$2.run(EventQueue.java:676)
    23     at java.awt.EventQueue$2.run(EventQueue.java:674)
    24     at java.security.AccessController.doPrivileged(Native Method)
    25     at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)
    26     at java.awt.EventQueue.dispatchEvent(EventQueue.java:685)
    27     at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:362)
    28     at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
    29     at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
    30     at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
    31     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
    32     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
    33     at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    34 Caused by: java.lang.UnsupportedClassVersionError: org/sonarlint/intellij/config/global/SonarLintGlobalSettings : Unsupported major.minor version 52.0
    35     at java.lang.ClassLoader.defineClass1(Native Method)
    36     at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)
    37     at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
    38     at java.lang.ClassLoader.defineClass(ClassLoader.java:471)
    39     at com.intellij.util.lang.UrlClassLoader._defineClass(UrlClassLoader.java:259)
    40     at com.intellij.util.lang.UrlClassLoader.defineClass(UrlClassLoader.java:255)
    41     at com.intellij.util.lang.UrlClassLoader._findClass(UrlClassLoader.java:231)
    42     at com.intellij.ide.plugins.cl.PluginClassLoader.b(PluginClassLoader.java:124)
    43     ... 30 more
    View Code

    原因:

    idea使用的jdk boot版本过低,需要升级jdk boot

    查看idea  jdk版本方法:

    IntelijIdea->abount IntelijIdea即可查看。

    我的解决办法:

      安装好新版的idea即可,默认的jdk版本为1.8.*. sonrlint可以正常使用。

    参考文章:

    1. http://www.importnew.com/24755.html

    2. https://stackoverflow.com/questions/37922780/plugin-org-sonarlint-idea-failed-to-initialize-and-will-be-disabled-please-re

      感谢各位作者

  • 相关阅读:
    206. 反转链表
    917. 仅仅反转字母
    哈希表的设计
    387. 字符串中的第一个唯一字符
    Mysql重连错误
    MySQL数据库的优化
    XML基础知识
    JS中的DOM与BOM
    JS中的函数,Array对象,for-in语句,with语句,自定义对象,Prototype
    表格标签,图片标签,框架标签,表单标签
  • 原文地址:https://www.cnblogs.com/daixianjun/p/idea-sonarlint.html
Copyright © 2020-2023  润新知