BUG: Specified Main Class 'Form1' Not Found

ID: Q194189


The information in this article applies to:
  • Microsoft Visual J++, version 6.0


SYMPTOMS

When you create a new Visual J++ 6.0 application, the wizard creates a class called Form1.java automatically. You can rename Form1.java to a more meaningful name. You also need to change all occurrences of "Form1" in the java code to the new name. After doing this you still get the following build error:

Specified main class 'Form1' not found


RESOLUTION

Use the following steps to work around the problem:

  1. From the Project menu, click Properties.


  2. Click the Launch tab and make sure your new name is in the "When project runs, load" drop-down list.


  3. Click OK.


The application will now build without error.


STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.


MORE INFORMATION

Steps to Reproduce Behavior

  1. Create a new Visual J++ 6.0 Windows application.


  2. Right-click on Form1.java in the Project Explorer, and click Rename.


  3. Type the new name (in this case, Joe.java).


  4. To change all occurrences of Form1 in the source code, close the Forms Designer.


  5. Right-click on Form1.java in the Project Explorer, and click View Code to open the source code.


  6. From the Edit menu, click Find and Replace, and replace all instances of Form1 with the new name (for example, replace Form1 with Joe).


  7. Build your application.


RESULT: The error "Specified main class 'Form1' not found" will appear in the Task List Output window.

NOTE: You might experience the same problem when changing the default name of any file that is marked as the project's entry-point file, such as a Page1.htm for a Web project, or Class1 for a console application.

© Microsoft Corporation 1998, All Rights Reserved.
Contributions by Rick Anderson, Microsoft Corporation

Additional query words:

Keywords : kbVJ600bug
Version : WINDOWS:6.0
Platform : WINDOWS
Issue type : kbbug


Last Reviewed: April 7, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.