BUG: Specified Main Class 'Form1' Not Found


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


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.


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
  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.


Id. de artículo: 194189 - Última revisión: 02/14/2017 - Revisión: 1

Microsoft Visual J++ 6.0 Edición estándar