SonarLint IntelliJ IDEA plugin doesn't load in Android Studio

1,054 views
Skip to first unread message

faba...@gmail.com

unread,
Mar 19, 2016, 10:22:42 AM3/19/16
to SonarLint
I tried installing the IntelliJ IDEA SonarLint plugin on both Android Studio and Android Studio 2.0 Beta but in both cases it crashed on startup with the following error:

com.intellij.diagnostic.PluginException: org/sonarlint/intellij/config/global/SonarLintGlobalSettings : Unsupported major.minor version 51.0 [Plugin: org.sonarlint.idea]
    at com.intellij.ide.plugins.cl.PluginClassLoader.loadClassInsideSelf(PluginClassLoader.java:130)
    at com.intellij.ide.plugins.cl.PluginClassLoader.tryLoadingClass(PluginClassLoader.java:77)
    at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:66)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:249)
    at com.intellij.openapi.components.impl.ComponentManagerImpl.registerComponents(ComponentManagerImpl.java:408)
    at com.intellij.openapi.components.impl.ComponentManagerImpl.init(ComponentManagerImpl.java:96)
    at com.intellij.openapi.application.impl.ApplicationImpl.load(ApplicationImpl.java:454)
    at com.intellij.openapi.application.impl.ApplicationImpl.load(ApplicationImpl.java:446)
    at com.intellij.idea.IdeaApplication.run(IdeaApplication.java:194)
    at com.intellij.idea.MainImpl$1$1$1.run(MainImpl.java:52)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:715)
    at java.awt.EventQueue.access$400(EventQueue.java:82)
    at java.awt.EventQueue$2.run(EventQueue.java:676)
    at java.awt.EventQueue$2.run(EventQueue.java:674)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:685)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:360)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Caused by: java.lang.UnsupportedClassVersionError: org/sonarlint/intellij/config/global/SonarLintGlobalSettings : Unsupported major.minor version 51.0
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:471)
    at com.intellij.util.lang.UrlClassLoader._defineClass(UrlClassLoader.java:257)
    at com.intellij.util.lang.UrlClassLoader.defineClass(UrlClassLoader.java:253)
    at com.intellij.util.lang.UrlClassLoader._findClass(UrlClassLoader.java:222)
    at com.intellij.ide.plugins.cl.PluginClassLoader.loadClassInsideSelf(PluginClassLoader.java:124)
    ... 26 more

This error caused Android Studio to exit and disable the plugin - tried re-enabling and restarting but got the same issue. I'm on OS X 10.9.5 with latest versions of Android Studio 1.5 & 2.0.

Can anyone help?

Duarte Meneses

unread,
Mar 21, 2016, 3:54:06 AM3/21/16
to faba...@gmail.com, SonarLint
I'm not familiar with Android Studio but it looks like there is a problem running java 7.
Are you running it with Java 7 or 8?

--
You received this message because you are subscribed to the Google Groups "SonarLint" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarlint+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarlint/5efc6b3f-e992-444a-af14-0ab9dbfc013e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Duarte MENESES | SonarSource

faba...@gmail.com

unread,
Mar 21, 2016, 4:35:56 AM3/21/16
to Duarte Meneses, SonarLint

Yes, Android Studio requires Java 7, does sonar lint only support up to 6?

Duarte Meneses

unread,
Mar 21, 2016, 5:57:10 AM3/21/16
to faba...@gmail.com, SonarLint
SonarLint requires java 7 or higher to run. The error indicates that the java runtime with which the plugin was loaded does not support Java 7.
I tried to install it in Android Studio and it is working.

Could you double check the Java runtime version in Help -> About?
I don't have other ideas about possible sources of the problem.



faba...@gmail.com

unread,
Mar 21, 2016, 10:03:24 AM3/21/16
to Duarte Meneses, SonarLint

Aha yes it works fine on my Linux machine at work, just not on my mac, so I think it might be something to do with the Mac version of Android Studio bundling a particular version of java or something - I recall reading a similar issue for people trying to use the findbugs plugin.

faba...@gmail.com

unread,
Mar 21, 2016, 7:08:14 PM3/21/16
to SonarLint, duarte....@sonarsource.com, faba...@gmail.com

Yep indeed this looks like the issue on Mac OS X: (annoyingly text was not selectable so had to screengrab)


I followed some instructions here for forcing it to run with JDK 7 by editing Info.plist - https://plugins.jetbrains.com/plugin/3847 - the good news is that SonarLint does now work :-) Hopefully everything else plays nice too with jre/jdk 7, we'll see..

Thanks for your help debugging!

Anita

Duarte Meneses

unread,
Mar 22, 2016, 3:47:55 AM3/22/16
to Anita Woodruff, SonarLint
Great! Please let us know if you run into problems, as we don't test it in Android Studio.

glst...@gmail.com

unread,
Jul 1, 2016, 8:55:30 AM7/1/16
to SonarLint, faba...@gmail.com
Hi everyone

Apologies for resurrecting an old thread, but I believe I am facing a similar issue and cannot get to the bottom of it.

I am running Android Studio 2.1.2, with JDK 1.7.0_79 on Windows 7. I've just installed the SonarLint plugin version 2.2.

When I go into settings I can add our SonarQube server, but cannot bind to it. When I close the settings dialog, I find the following exception in the Event Log:

cannot reset configurable: The plugin [javascript] does not support Java 1.7.0_79
java.lang.IllegalStateException: The plugin [javascript] does not support Java 1.7.0_79
at org.sonarsource.sonarlint.core.plugin.PluginLoader.instantiatePluginClasses(PluginLoader.java:130)
at org.sonarsource.sonarlint.core.plugin.PluginLoader.load(PluginLoader.java:65)
at org.sonarsource.sonarlint.core.plugin.DefaultPluginRepository.start(DefaultPluginRepository.java:51)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(ReflectionLifecycleStrategy.java:110)
at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.start(ReflectionLifecycleStrategy.java:89)
at org.sonarsource.sonarlint.core.container.ComponentContainer$1.start(ComponentContainer.java:279)
at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(AbstractInjectionFactory.java:84)
at org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.java:169)
at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Stored.java:132)
at org.picocontainer.behaviors.Stored.start(Stored.java:110)
at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(DefaultPicoContainer.java:1016)
at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1009)
at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:767)
at org.sonarsource.sonarlint.core.container.ComponentContainer.startComponents(ComponentContainer.java:124)
at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.start(ConnectedSonarLintEngineImpl.java:104)
at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.<init>(ConnectedSonarLintEngineImpl.java:67)
at org.sonarlint.intellij.core.SonarLintServerManager.createEngine(SonarLintServerManager.java:212)
at org.sonarlint.intellij.core.SonarLintServerManager.getConnectedEngine(SonarLintServerManager.java:94)
at org.sonarlint.intellij.config.global.SonarQubeServerMgmtPanel.switchTo(SonarQubeServerMgmtPanel.java:294)
at org.sonarlint.intellij.config.global.SonarQubeServerMgmtPanel.onServerSelect(SonarQubeServerMgmtPanel.java:283)
at org.sonarlint.intellij.config.global.SonarQubeServerMgmtPanel.access$100(SonarQubeServerMgmtPanel.java:85)
at org.sonarlint.intellij.config.global.SonarQubeServerMgmtPanel$2.valueChanged(SonarQubeServerMgmtPanel.java:128)
at javax.swing.JList.fireSelectionValueChanged(JList.java:1798)
at javax.swing.JList$ListSelectionHandler.valueChanged(JList.java:1812)
at javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:184)
at javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:164)
at javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:211)
at javax.swing.DefaultListSelectionModel.changeSelection(DefaultListSelectionModel.java:405)
at javax.swing.DefaultListSelectionModel.changeSelection(DefaultListSelectionModel.java:415)
at javax.swing.DefaultListSelectionModel.setSelectionInterval(DefaultListSelectionModel.java:459)
at javax.swing.JList.setSelectedIndex(JList.java:2212)
at javax.swing.JList.setSelectedValue(JList.java:2362)
at org.sonarlint.intellij.config.global.SonarQubeServerMgmtPanel.load(SonarQubeServerMgmtPanel.java:273)
at org.sonarlint.intellij.config.global.SonarLintGlobalConfigurable.reset(SonarLintGlobalConfigurable.java:72)
at com.intellij.openapi.options.ex.ConfigurableWrapper.reset(ConfigurableWrapper.java:185)
at com.intellij.openapi.options.ex.ConfigurableCardPanel.reset(ConfigurableCardPanel.java:124)
at com.intellij.openapi.options.ex.ConfigurableCardPanel$1.compute(ConfigurableCardPanel.java:80)
at com.intellij.openapi.options.ex.ConfigurableCardPanel$1.compute(ConfigurableCardPanel.java:65)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:963)
at com.intellij.openapi.options.ex.ConfigurableCardPanel.create(ConfigurableCardPanel.java:65)
at com.intellij.openapi.options.newEditor.ConfigurableEditor$1.create(ConfigurableEditor.java:70)
at com.intellij.openapi.options.newEditor.ConfigurableEditor$1.create(ConfigurableEditor.java:67)
at com.intellij.ui.CardLayoutPanel.createValue(CardLayoutPanel.java:87)
at com.intellij.ui.CardLayoutPanel.select(CardLayoutPanel.java:115)
at com.intellij.ui.CardLayoutPanel.access$100(CardLayoutPanel.java:40)
at com.intellij.ui.CardLayoutPanel$1$1.run(CardLayoutPanel.java:134)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(LaterInvocator.java:337)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:321)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:312)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:745)
at java.awt.EventQueue.access$300(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:706)
at java.awt.EventQueue$3.run(EventQueue.java:704)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:715)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:866)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:654)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:381)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:154)
at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:182)
at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:221)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:219)
at java.awt.Dialog.show(Dialog.java:1082)
at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl$MyDialog.show(DialogWrapperPeerImpl.java:792)
at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl.show(DialogWrapperPeerImpl.java:465)
at com.intellij.openapi.ui.DialogWrapper.invokeShow(DialogWrapper.java:1638)
at com.intellij.openapi.ui.DialogWrapper.show(DialogWrapper.java:1587)
at com.intellij.ide.actions.ShowSettingsUtilImpl.showSettingsDialog(ShowSettingsUtilImpl.java:118)
at com.intellij.ide.actions.ShowSettingsAction.actionPerformed(ShowSettingsAction.java:65)
at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:182)
at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter$1.run(ActionMenuItem.java:311)
at com.intellij.openapi.wm.impl.FocusManagerImpl.runOnOwnContext(FocusManagerImpl.java:958)
at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.runOnOwnContext(IdeFocusManagerImpl.java:124)
at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.actionPerformed(ActionMenuItem.java:281)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
at com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed(ActionMenuItem.java:109)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.JToggleButton$ToggleButtonModel.setPressed(JToggleButton.java:308)
at javax.swing.AbstractButton.doClick(AbstractButton.java:376)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:833)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:877)
at java.awt.Component.processMouseEvent(Component.java:6516)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
at java.awt.Component.processEvent(Component.java:6281)
at java.awt.Container.processEvent(Container.java:2229)
at java.awt.Component.dispatchEventImpl(Component.java:4872)
at java.awt.Container.dispatchEventImpl(Container.java:2287)
at java.awt.Component.dispatchEvent(Component.java:4698)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
at java.awt.Container.dispatchEventImpl(Container.java:2273)
at java.awt.Window.dispatchEventImpl(Window.java:2719)
at java.awt.Component.dispatchEvent(Component.java:4698)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:747)
at java.awt.EventQueue.access$300(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:706)
at java.awt.EventQueue$3.run(EventQueue.java:704)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.awt.EventQueue$4.run(EventQueue.java:720)
at java.awt.EventQueue$4.run(EventQueue.java:718)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:717)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:866)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:650)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:381)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
Caused by: java.lang.UnsupportedClassVersionError: org/sonar/plugins/javascript/JavaScriptPlugin : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at org.sonar.classloader.ClassRealm.loadClassFromSelf(ClassRealm.java:125)
at org.sonar.classloader.ParentFirstStrategy.loadClass(ParentFirstStrategy.java:37)
at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:87)
at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:76)
at org.sonarsource.sonarlint.core.plugin.PluginLoader.instantiatePluginClasses(PluginLoader.java:128)
... 123 more

Can anyone suggest what might be causing this issue? My colleague has installed the plugin without any problems and we cannot see any obvious differences between the two machines.

I should point out I'm quite new to Android Studio, please let me know if I need to supply more information.

Thanks
Gregor

duarte.meneses

unread,
Jul 1, 2016, 10:55:29 AM7/1/16
to SonarLint, faba...@gmail.com, glst...@gmail.com
Hi,

"The plugin [javascript] does not support Java 1.7.0_79"

You are probably using a very recent version of Javascript (2.14), which supports only Java >= 8.
Try to switch to Java 8.

glst...@gmail.com

unread,
Jul 4, 2016, 7:42:54 AM7/4/16
to SonarLint, faba...@gmail.com, glst...@gmail.com
Thanks for replying. Java 8 has indeed solved the issue.
Reply all
Reply to author
Forward
0 new messages