FIX: Error J0049: Undefined name "XXX" in Visual J++

Last reviewed: March 4, 1998
Article ID: Q158221
The information in this article applies to:
  • Microsoft Visual J++, version 1.0, 1.1

SYMPTOMS

When the simple name of the package that you are creating is the same name as the package prefix that contains the class you are importing, the following compile time error occurs:

   Error J0049:  Undefined name "XXX"

Where "XXX" is the package name that the user imported.

WORKAROUND

You can work around this error by using a different name for the package that you import, or you can change the name for the package that you are creating.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem has been fixed in the updated compiler (jvc) from the SDK for Java 2.01 and Service Patch 3 for Visual Studio. Both are needed to resolve the problem.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Create a Java workspace that contains the following classes:

          //[Test1.java]
          package mypacket.bar;
          import bar.Test2;
    

          class Test1
          {
          }
    

          //[Test2.java]
          package bar;
    

          class Test2
          {
          }
    

  2. Set the output directory to some valid directory on disk.

  3. Attempt to build the project.

The Error J0049: Undefined name "bar.Test2" appears.

REFERENCES

For more information on where to obtain Service Patch 3, see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q170365
   TITLE     : INFO: Visual Studio 97 Service Packs - What, Where, and Why

The SDK for Java 2.01 can be found at http://www.microsoft.com/java/.

For the latest Knowledge Base articles and other support information on Visual J++ and the SDK for Java, see the following page on the Microsoft Technical Support site:

   http://support.microsoft.com/support/visualj/
   http://support.microsoft.com/support/java/

Keywords          : kbtool VJGenIss
Technology        : kbInetDev
Version           : 1.0 1.1
Platform          : WINDOWS
Issue type        : kbbug
Solution Type     : kbfix


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: March 4, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.