Microsoft KB Archive/194189

= BUG: Specified Main Class 'Form1' Not Found =

Article ID: 194189

Article Last Modified on 3/7/2005

-

APPLIES TO


 * Microsoft Visual J++ 6.0 Standard Edition

-



This article was previously published under Q194189



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 that this is a bug in the Microsoft products that are listed at the beginning of this article.



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.

Keywords: kbbug kbpending KB194189

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.