Community
Participate
Working Groups
When creating a new java class, on execution an error message "The active editor does not contain a main type" appears. To get arround this eclipse must be restarted, and then the class can be executed.
Greg, which build are you using and is there anything in the log file. And can you please provide steps to reproduce.
Hello, The build is RC3. Version: 3.0.0 Build id: 200406192000 If I create a class without changing the defaults. Then try and launch it, it comes up with the message(Dump time: 2004 16:33:12.221) Also if I right click on the class then run or debug, the selection context is empty (Dump Time:2004 16:34:11.898). Here is the dump. (2004 16:33:12.221). !SESSION Jul 13, 2004 16:33:12.221 --------------------------------------------- eclipse.buildId=I200406192000 java.fullversion=J2RE 1.4.1 IBM build cxia321411-20040301 (JIT enabled: jitc) BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_GB !ENTRY org.eclipse.core.resources 2 1 Jul 13, 2004 16:33:12.223 !MESSAGE Skipping builder com.ibm.etools.validation.validationbuilder for project Development Library. Either the builder is missing from the install, or it belongs to a project nature that is missing or disabled. !ENTRY org.eclipse.jdt.core 4 4 Jul 13, 2004 16:33:12.256 !MESSAGE Background Indexer Crash Recovery !STACK 0 java.lang.NullPointerException at java.lang.SecurityManager.checkRead(SecurityManager.java:900) at java.io.FileInputStream.<init>(FileInputStream.java(Inlined Compiled Code)) at org.eclipse.jdt.internal.core.index.DiskIndex.readCategoryTable (DiskIndex.java(Compiled Code)) at org.eclipse.jdt.internal.core.index.DiskIndex.mergeCategory (DiskIndex.java:360) at org.eclipse.jdt.internal.core.index.DiskIndex.mergeCategories (DiskIndex.java:352) at org.eclipse.jdt.internal.core.index.DiskIndex.mergeWith (DiskIndex.java(Compiled Code)) at org.eclipse.jdt.internal.core.index.Index.save(Index.java:171) at org.eclipse.jdt.internal.core.search.indexing.IndexManager.saveIndex (IndexManager.java:506) at org.eclipse.jdt.internal.core.search.indexing.IndexManager.saveIndexes (IndexManager.java:548) at org.eclipse.jdt.internal.core.search.indexing.IndexManager.notifyIdle (IndexManager.java:369) at org.eclipse.jdt.internal.core.search.processing.JobManager.run (JobManager.java:344) at java.lang.Thread.run(Thread.java:568) !ENTRY org.eclipse.jdt.core 4 4 Jul 13, 2004 16:34:11.898 !MESSAGE Background Indexer Crash Recovery !STACK 0 java.lang.NullPointerException at java.lang.SecurityManager.checkRead(SecurityManager.java:900) at java.io.FileInputStream.<init>(FileInputStream.java(Inlined Compiled Code)) at org.eclipse.jdt.internal.core.index.DiskIndex.readCategoryTable (DiskIndex.java(Compiled Code)) at org.eclipse.jdt.internal.core.index.DiskIndex.mergeCategory (DiskIndex.java:360) at org.eclipse.jdt.internal.core.index.DiskIndex.mergeCategories (DiskIndex.java:352) at org.eclipse.jdt.internal.core.index.DiskIndex.mergeWith (DiskIndex.java(Compiled Code)) at org.eclipse.jdt.internal.core.index.Index.save(Index.java:171) at org.eclipse.jdt.internal.core.search.indexing.IndexManager.saveIndex (IndexManager.java:506) at org.eclipse.jdt.internal.core.search.indexing.SaveIndex.execute (SaveIndex.java:40) at org.eclipse.jdt.internal.core.search.processing.JobManager.run (JobManager.java:361) at java.lang.Thread.run(Thread.java:568) !ENTRY org.eclipse.ui 4 4 Jul 13, 2004 16:34:11.908 !MESSAGE Unhandled event loop exception !ENTRY org.eclipse.ui 4 0 Jul 13, 2004 16:34:11.908 !MESSAGE java.lang.NullPointerException !STACK 0 java.lang.NullPointerException at org.eclipse.jdt.internal.core.search.indexing.IndexManager.getIndex (IndexManager.java:183) at org.eclipse.jdt.internal.core.search.PatternSearchJob.getIndexes (PatternSearchJob.java:90) at org.eclipse.jdt.internal.core.search.PatternSearchJob.execute (PatternSearchJob.java:58) at org.eclipse.jdt.internal.core.search.processing.JobManager.performConcurrentJob (JobManager.java:253) at org.eclipse.jdt.internal.core.hierarchy.IndexBasedHierarchyBuilder.searchAllPoss ibleSubTypes(IndexBasedHierarchyBuilder.java:487) at org.eclipse.jdt.internal.core.hierarchy.IndexBasedHierarchyBuilder.determinePoss ibleSubTypes(IndexBasedHierarchyBuilder.java:378) at org.eclipse.jdt.internal.core.hierarchy.IndexBasedHierarchyBuilder.build (IndexBasedHierarchyBuilder.java:120) at org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy.compute (TypeHierarchy.java:319) at org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy.refresh (TypeHierarchy.java:1234) at org.eclipse.jdt.internal.core.CreateTypeHierarchyOperation.executeOperation (CreateTypeHierarchyOperation.java:90) at org.eclipse.jdt.internal.core.JavaModelOperation.run (JavaModelOperation.java:700) at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation (JavaModelOperation.java:739) at org.eclipse.jdt.internal.core.BinaryType.newTypeHierarchy (BinaryType.java:666) at org.eclipse.jdt.internal.core.BinaryType.newTypeHierarchy (BinaryType.java:636) at org.eclipse.jdt.internal.debug.ui.launcher.AppletLaunchConfigurationUtils.collec tAppletTypesInProject(AppletLaunchConfigurationUtils.java:115) at org.eclipse.jdt.internal.debug.ui.launcher.AppletLaunchConfigurationUtils.isSubc lassOfApplet(AppletLaunchConfigurationUtils.java:183) at org.eclipse.jdt.internal.debug.ui.launcher.AppletLaunchConfigurationUtils.collec tTypes(AppletLaunchConfigurationUtils.java:148) at org.eclipse.jdt.internal.debug.ui.launcher.JavaElementPropertyTester.isApplet (JavaElementPropertyTester.java:77) at org.eclipse.jdt.internal.debug.ui.launcher.JavaElementPropertyTester.test (JavaElementPropertyTester.java:61) at org.eclipse.core.internal.expressions.Property.test(Property.java:52) at org.eclipse.core.internal.expressions.TestExpression.evaluate (TestExpression.java:57) at org.eclipse.core.internal.expressions.CompositeExpression.evaluateAnd (CompositeExpression.java:50) at org.eclipse.core.internal.expressions.IterateExpression.evaluate (IterateExpression.java:107) at org.eclipse.core.internal.expressions.CompositeExpression.evaluateAnd (CompositeExpression.java:50) at org.eclipse.core.internal.expressions.WithExpression.evaluate (WithExpression.java:37) at org.eclipse.core.internal.expressions.CompositeExpression.evaluateAnd (CompositeExpression.java:50) at org.eclipse.core.internal.expressions.EnablementExpression.evaluate (EnablementExpression.java:28) at org.eclipse.debug.internal.ui.launchConfigurations.LaunchShortcutExtension.evalE nablementExpression(LaunchShortcutExtension.java:172) at org.eclipse.debug.ui.actions.ContextualLaunchAction.isApplicable (ContextualLaunchAction.java:257) at org.eclipse.debug.ui.actions.ContextualLaunchAction.fillMenu (ContextualLaunchAction.java:191) at org.eclipse.debug.ui.actions.ContextualLaunchAction.access$1 (ContextualLaunchAction.java:173) at org.eclipse.debug.ui.actions.ContextualLaunchAction$1.menuShown (ContextualLaunchAction.java:134) at org.eclipse.swt.widgets.TypedListener.handleEvent (TypedListener.java:116) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java(Inlined Compiled Code)) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:955) at org.eclipse.swt.widgets.Menu.gtk_show(Menu.java:561) at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:1174) at org.eclipse.swt.widgets.Display.windowProc(Display.java:3078) at org.eclipse.swt.internal.gtk.OS.gtk_main_iteration(Native Method) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1346) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench (Workbench.java:252) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:141) at org.eclipse.ui.internal.ide.IDEApplication.run (IDEApplication.java:96) at org.eclipse.core.internal.runtime.PlatformActivator$1.run (PlatformActivator.java:335) at org.eclipse.core.runtime.adaptor.EclipseStarter.run (EclipseStarter.java:272) at org.eclipse.core.runtime.adaptor.EclipseStarter.run (EclipseStarter.java:128) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:79) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:41) at java.lang.reflect.Method.invoke(Method.java:386) at org.eclipse.core.launcher.Main.basicRun(Main.java:186) at org.eclipse.core.launcher.Main.run(Main.java:647) at org.eclipse.core.launcher.Main.main(Main.java:631)
The problem seems to be caused by some problems in the indexer, hence JDT thinks that the class doesn't have a main method. Moving to JDT/Core.
Seems to be fixed in 3.0. Cheers!
I don't think we did change anything in between RC3 and 3.0 in this area. Kent ?
This was caused by a VM bug with IBM build cxia321411-20040301 (JIT enabled: jitc). There are newer versions of this VM available - you should switch. We worked around it by changing our call to FileInputStream() to supply the default size instead of using the static constant, which the JIT was incorrectly picking up as <= 0. *** This bug has been marked as a duplicate of 66836 ***