Microsoft KB Archive/158221

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

Article ID: 158221

Article Last Modified on 5/12/2007

-

APPLIES TO


 * Microsoft Visual J++ 1.0 Standard Edition
 * Microsoft Visual J++ 1.1 Standard Edition

-



This article was previously published under Q158221



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 Java Language Compiler (jvc) from the SDK for Java 2.01 and Service Patch 3 for Visual Studio. Both the compiler from the SDK for Java and the Service Patch 3 are needed to resolve the problem.



Steps to Reproduce the Behavior
  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 {     }                     Set the output directory to some valid directory on disk. Try to build the project.

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

