Can't start a main class


#1

I can't seem to run my class any more:

/uploads/kotlinlang/original/1X/966593f1b7e5649f2841f8497dbd2808aef654ec.png

Note that the “Run” icon is greyed out, and if I right click on my source, I don’t see the “Run” menu.

Using 116.08 and Kotlin plugin 0.1.1842.

Am I missing something?


Can't start a main class
#2

My stuff still runs, using 116.108 and 0.1.1844.

Try removing the lib/ directory, the module dependency on the runtime, and let the IDE prompt you to add it back in.


#3

Already tried that a few times, trying both the default lib/ and the one under my kotlinc installation, it didn't fix anything.


#4

You may need to update IDEA to the latest EAP.


#5

Does adding ": Unit" to the function help? Have noticed the Run option is quite sensitive to the return type


#6

I can't remember any reports like that from you :) Please, share if you have problems of this sort in the future.


#7

I believe I already am using the latest version, 116.108, which IDEA confirmed.


#8

Nope, that didn't help.

I created a brand new module, same problem. Guess my installation might be hosed?


#9

Actually no return type, Int and Unit return types all work for me here. Apologies for doubting the Kotlin plugin Andrey :)

Samples here: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib/test/language/main


#10

Hm, never knew that Int would be OK there...


#11

I uninstalled the EAP, re-installed it (116.108), installed the Kotlin plug-in again and same thing: I can't run even a two line "hello world".

Are you seeing anything suspicious in this screen shot?

What can I do to investigate this? Any logs anywhere that could help?


#12

If you attach a zip file of your project, I"ll try to run it. M


#13

If you haven't already, you may try to sandbox EAP 11.1 per an earlier thread.  That should be Step 0 no matter what you're working on if you also use 11.0.x for your day job.  


#14

I just noticed that the Kotlin plug-in appears to blow up at init time. Could this explain the behavior I'm seeing?

update failed for AnAction with ID=CreateRunConfiguration: com/intellij/execution/junit/JUnitConfigurationType java.lang.NoClassDefFoundError: com/intellij/execution/junit/JUnitConfigurationType      at org.jetbrains.jet.plugin.run.JetJUnitConfigurationProducer.<init>(JetJUnitConfigurationProducer.java:44)      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)      at java.lang.reflect.Constructor.newInstance(Constructor.java:513)      at org.picocontainer.defaults.InstantiatingComponentAdapter.newInstance(InstantiatingComponentAdapter.java:193)      at org.picocontainer.defaults.ConstructorInjectionComponentAdapter$1.run(ConstructorInjectionComponentAdapter.java:220)      at org.picocontainer.defaults.ThreadLocalCyclicDependencyGuard.observe(ThreadLocalCyclicDependencyGuard.java:53)      at org.picocontainer.defaults.ConstructorInjectionComponentAdapter.getComponentInstance(ConstructorInjectionComponentAdapter.java:248)      at org.picocontainer.defaults.DecoratingComponentAdapter.getComponentInstance(DecoratingComponentAdapter.java:60)      at org.picocontainer.defaults.CachingComponentAdapter.getComponentInstance(CachingComponentAdapter.java:58)      at com.intellij.openapi.extensions.impl.ExtensionComponentAdapter.getComponentInstance(ExtensionComponentAdapter.java:74)      at com.intellij.openapi.extensions.impl.ExtensionComponentAdapter.getExtension(ExtensionComponentAdapter.java:111)      at com.intellij.openapi.extensions.impl.ExtensionPointImpl.processAdapters(ExtensionPointImpl.java:225)      at com.intellij.openapi.extensions.impl.ExtensionPointImpl.getExtensions(ExtensionPointImpl.java:171)      at com.intellij.openapi.application.impl.ApplicationImpl.getExtensions(ApplicationImpl.java:1308)      at com.intellij.execution.actions.PreferredProducerFind.findPreferredProducers(PreferredProducerFind.java:53)      at com.intellij.execution.actions.ConfigurationContext.findPreferredProducers(ConfigurationContext.java:199)      at com.intellij.execution.actions.ConfigurationContext.findExisting(ConfigurationContext.java:132)      at com.intellij.execution.actions.BaseRunConfigurationAction.update(BaseRunConfigurationAction.java:185)      at com.intellij.openapi.actionSystem.ex.ActionUtil.performDumbAwareUpdate(ActionUtil.java:98)      at com.intellij.openapi.actionSystem.impl.Utils.a(Utils.java:163)      at com.intellij.openapi.actionSystem.impl.Utils.expandActionGroup(Utils.java:124)      at com.intellij.openapi.actionSystem.impl.Utils.expandActionGroup(Utils.java:84)      at com.intellij.openapi.actionSystem.impl.Utils.expandActionGroup(Utils.java:142)      at com.intellij.openapi.actionSystem.impl.Utils.expandActionGroup(Utils.java:84)      at com.intellij.openapi.actionSystem.impl.Utils.expandActionGroup(Utils.java:142)      at com.intellij.openapi.actionSystem.impl.Utils.expandActionGroup(Utils.java:84)      at com.intellij.openapi.actionSystem.impl.Utils.expandActionGroup(Utils.java:142)      at com.intellij.openapi.actionSystem.impl.Utils.expandActionGroup(Utils.java:84)      at com.intellij.openapi.actionSystem.impl.Utils.fillMenu(Utils.java:236)      at com.intellij.openapi.actionSystem.impl.ActionPopupMenuImpl$MyMenu.show(ActionPopupMenuImpl.java:95)      at com.intellij.ide.ui.customization.CustomizationUtil$3.invokePopup(CustomizationUtil.java:323)      at com.intellij.ui.PopupHandler.mousePressed(PopupHandler.java:48)      at java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:263)      at java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:262)      at java.awt.Component.processMouseEvent(Component.java:6370)      at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)      at com.intellij.ui.treeStructure.Tree.processMouseEvent(Tree.java:323)      at com.intellij.ide.dnd.aware.DnDAwareTree.processMouseEvent(DnDAwareTree.java:50)      at java.awt.Component.processEvent(Component.java:6138)      at java.awt.Container.processEvent(Container.java:2085)      at java.awt.Component.dispatchEventImpl(Component.java:4735)      at java.awt.Container.dispatchEventImpl(Container.java:2143)      at java.awt.Component.dispatchEvent(Component.java:4565)      at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4621)      at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4279)      at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4212)      at java.awt.Container.dispatchEventImpl(Container.java:2129)      at java.awt.Window.dispatchEventImpl(Window.java:2478)      at java.awt.Component.dispatchEvent(Component.java:4565)      at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:679)      at java.awt.EventQueue.access$000(EventQueue.java:85)      at java.awt.EventQueue$1.run(EventQueue.java:638)      at java.awt.EventQueue$1.run(EventQueue.java:636)      at java.security.AccessController.doPrivileged(Native Method)      at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)      at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)      at java.awt.EventQueue$2.run(EventQueue.java:652)      at java.awt.EventQueue$2.run(EventQueue.java:650)      at java.security.AccessController.doPrivileged(Native Method)      at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)      at java.awt.EventQueue.dispatchEvent(EventQueue.java:649)      at com.intellij.ide.IdeEventQueue.e(IdeEventQueue.java:699)      at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:534)      at com.intellij.ide.IdeEventQueue.b(IdeEventQueue.java:420)      at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:378)      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.ClassNotFoundException: com.intellij.execution.junit.JUnitConfigurationType PluginClassLoader[Kotlin, 0.1.1842]      at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:77)      at java.lang.ClassLoader.loadClass(ClassLoader.java:247)      ... 73 more


#15

If you right-click your editor, does the popup menu say anything about "Run 'namespace'" or "Run something else"?


#16

No, there is no "Run" menu, and the Run arrow in the toolbar is disabled as well. That's what I reported in the very first message.


#17

The icon is greyed because there are no run configurations available. Try to open Edit configurations dialog and delete all the configurations related to Kotlin. If after that the 'Run' items do not appear on the popup menu in the editor, try to create a Kotlin run configuration manually in the same Edit configurations dialog.

Please, tell me what steps failed if any, it will help us localize the problem. Thanks


#18

This bug is really strange. I reproduced similar behaviour (exception on startup and absence of run items in menu) after deactivatation of junit plug-in. So think that exception is important. But in my case exception is different and more expected - JUnitConfiguration class not found. Let's try to understand why class loader was unable to find JUnitConfigurationType on your machine. First of all, could you confirm that you have clean installation of 116.108 with junit enabled and without any additional plugin-is? Another thing to check is existance of JUnitConfigurationType in IDEA_INSTALLpluginsjunitlibidea-junit.jarcomintellijexecutionjunit.


#19

There are no configurations and each time I try to create a Kotlin one (pressing on the + button and selecting "Kotlin"), I get the following exception:

Error during dispatching of java.awt.event.MouseEvent[MOUSE_RELEASED,(42,93),absolute(482,348),button=1,modifiers=Button1,clickCount=1] on dialog4
java.lang.NullPointerException
at org.jetbrains.jet.plugin.run.JetRunConfigurationEditor.resetEditorFrom(JetRunConfigurationEditor.java:58)
at org.jetbrains.jet.plugin.run.JetRunConfigurationEditor.resetEditorFrom(JetRunConfigurationEditor.java:36)
at com.intellij.openapi.options.SettingsEditor.resetFrom(SettingsEditor.java:85)
at com.intellij.execution.impl.ConfigurationSettingsEditor$ConfigToSettingsWrapper.resetEditorFrom(ConfigurationSettingsEditor.java:232)
at com.intellij.execution.impl.ConfigurationSettingsEditor$ConfigToSettingsWrapper.resetEditorFrom(ConfigurationSettingsEditor.java:221)
at com.intellij.openapi.options.CompositeSettingsEditor.resetEditorFrom(CompositeSettingsEditor.java:47)
at com.intellij.execution.impl.ConfigurationSettingsEditorWrapper.resetEditorFrom(ConfigurationSettingsEditorWrapper.java:157)
at com.intellij.execution.impl.ConfigurationSettingsEditorWrapper.resetEditorFrom(ConfigurationSettingsEditorWrapper.java:53)
at com.intellij.openapi.options.SettingsEditor.resetFrom(SettingsEditor.java:85)
at com.intellij.openapi.options.SettingsEditorConfigurable.reset(SettingsEditorConfigurable.java:50)
at com.intellij.execution.impl.SingleConfigurationConfigurable.reset(SingleConfigurationConfigurable.java:92)
at com.intellij.execution.impl.SingleConfigurationConfigurable.editSettings(SingleConfigurationConfigurable.java:78)
at com.intellij.execution.impl.RunConfigurable.a(RunConfigurable.java:842)
at com.intellij.execution.impl.RunConfigurable.b(RunConfigurable.java:878)
at com.intellij.execution.impl.RunConfigurable.access$1500(RunConfigurable.java:71)
at com.intellij.execution.impl.RunConfigurable$MyToolbarAddAction$2.onChosen(RunConfigurable.java:925)
at com.intellij.execution.impl.RunConfigurable$MyToolbarAddAction$2.onChosen(RunConfigurable.java:898)
at com.intellij.ui.popup.list.ListPopupImpl.a(ListPopupImpl.java:318)
at com.intellij.ui.popup.list.ListPopupImpl.handleSelect(ListPopupImpl.java:288)
at com.intellij.ui.popup.list.ListPopupImpl$MyMouseListener.mouseReleased(ListPopupImpl.java:397)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:273)
at java.awt.Component.processMouseEvent(Component.java:6373)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
at java.awt.Component.processEvent(Component.java:6138)
at java.awt.Container.processEvent(Container.java:2085)
at java.awt.Component.dispatchEventImpl(Component.java:4735)
at java.awt.Container.dispatchEventImpl(Container.java:2143)
at java.awt.Component.dispatchEvent(Component.java:4565)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4621)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4282)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4212)
at java.awt.Container.dispatchEventImpl(Container.java:2129)
at java.awt.Window.dispatchEventImpl(Window.java:2478)
at java.awt.Component.dispatchEvent(Component.java:4565)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:679)
at java.awt.EventQueue.access$000(EventQueue.java:85)
at java.awt.EventQueue$1.run(EventQueue.java:638)
at java.awt.EventQueue$1.run(EventQueue.java:636)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
at java.awt.EventQueue$2.run(EventQueue.java:652)
at java.awt.EventQueue$2.run(EventQueue.java:650)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:649)
at com.intellij.ide.IdeEventQueue.e(IdeEventQueue.java:699)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:534)
at com.intellij.ide.IdeEventQueue.b(IdeEventQueue.java:420)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:378)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:205)
at java.awt.Dialog$1.run(Dialog.java:1046)
at java.awt.Dialog$3.run(Dialog.java:1098)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Dialog.show(Dialog.java:1096)
at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl$MyDialog.a(DialogWrapperPeerImpl.java:742)
at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl$MyDialog.show(DialogWrapperPeerImpl.java:738)
at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl.show(DialogWrapperPeerImpl.java:426)
at com.intellij.openapi.ui.DialogWrapper.showAndGetOk(DialogWrapper.java:1379)
at com.intellij.openapi.ui.DialogWrapper.show(DialogWrapper.java:1364)
at com.intellij.execution.actions.EditRunConfigurationsAction.actionPerformed(EditRunConfigurationsAction.java:46)
at com.intellij.ui.popup.PopupFactoryImpl$ActionPopupStep$1.run(PopupFactoryImpl.java:592)
at com.intellij.ui.popup.AbstractPopup$17.run(AbstractPopup.java:1162)
at com.intellij.openapi.wm.impl.FocusManagerImpl.a(FocusManagerImpl.java:614)
at com.intellij.openapi.wm.impl.FocusManagerImpl.g(FocusManagerImpl.java:595)
at com.intellij.openapi.wm.impl.FocusManagerImpl.e(FocusManagerImpl.java:565)
at com.intellij.openapi.wm.impl.FocusManagerImpl.access$200(FocusManagerImpl.java:55)
at com.intellij.openapi.wm.impl.FocusManagerImpl$IdleRunnable.runEdt(FocusManagerImpl.java:102)
at com.intellij.openapi.util.EdtRunnable$1.run(EdtRunnable.java:28)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:677)
at java.awt.EventQueue.access$000(EventQueue.java:85)
at java.awt.EventQueue$1.run(EventQueue.java:638)
at java.awt.EventQueue$1.run(EventQueue.java:636)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:647)
at com.intellij.ide.IdeEventQueue.e(IdeEventQueue.java:699)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:538)
at com.intellij.ide.IdeEventQueue.b(IdeEventQueue.java:420)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:378)
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)


#20

Hi Nikolay,

Indeed, the JUnit plug-in was disabled. I enabled it and I can now see a “Run namespace” menu when I right click on my function. However, when I try to run “namespace”, I now get the following exception:

/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java -Didea.launcher.port=7541 -Didea.launcher.bin.path=/Applications/Nika.1-IU-116.108.app/bin -Dfile.encoding=UTF-8 -classpath /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/deploy.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/dt.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/javaws.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/jce.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/jconsole.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/management-agent.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/plugin.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/sa-jdi.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/charsets.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/classes.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/jsse.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/ui.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/ext/apple_provider.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/ext/dnsns.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/ext/localedata.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/ext/sunjce_provider.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/ext/sunpkcs11.jar:/Users/cedric/IdeaProjects/Kotlin4/out/test/Kotlin4:/Users/cedric/IdeaProjects/Kotlin4/out/production/Kotlin4:/Users/cedric/IdeaProjects/Kotlin4/lib/kotlin-runtime.jar:/Applications/Nika.1-IU-116.108.app/lib/idea_rt.jar com.intellij.rt.execution.application.AppMain namespace Exception in thread "main" java.lang.ClassNotFoundException: namespace      at java.net.URLClassLoader$1.run(URLClassLoader.java:202)      at java.security.AccessController.doPrivileged(Native Method)      at java.net.URLClassLoader.findClass(URLClassLoader.java:190)      at java.lang.ClassLoader.loadClass(ClassLoader.java:306)      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)      at java.lang.ClassLoader.loadClass(ClassLoader.java:247)      at java.lang.Class.forName0(Native Method)      at java.lang.Class.forName(Class.java:169)      at com.intellij.rt.execution.application.AppMain.main(AppMain.java:113)

Process finished with exit code 1