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:
- From the Project menu, click Properties.
- Click the Launch tab and make sure your new name is in the "When project
runs, load" drop-down list.
- 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
- Create a new Visual J++ 6.0 Windows application.
- Right-click on Form1.java in the Project Explorer, and click Rename.
- Type the new name (in this case, Joe.java).
- To change all occurrences of Form1 in the source code, close the Forms
Designer.
- Right-click on Form1.java in the Project Explorer, and click View Code to
open the source code.
- From the Edit menu, click Find and Replace, and replace all instances
of Form1 with the new name (for example, replace Form1 with Joe).
- 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