Microsoft SDK for Java

J5021-J5500

J5021 J5022 J5023
J5024 J5025-J5499 J5500

J5021 - Package 'identifier' should not be defined in directory 'identifier'

The compiler detected a package statement in your source file but the directory name where the source file resides does not match the package statement. Although the source code will compile, other source files will not be able to reference classes, interfaces, and delegates defined in this source file using the package name.

The following example illustrates this warning.

//source file resides in c:\files\simple
package boxes; //warning: package 'boxes' does not match directory name
'simple'
public class NotSimple{
  //warning: this class is not accessible using the current package name
}

J5022 - Referenced class file 'filename' may be older than 'filename'

The compiler detected a class file, which is referenced by the source file being compiled, that is out of date or not found. This warning usually occurs when automatic re-compilation of referenced classes has been disabled (using the ref- compiler option). If you are compiling within Visual J++, the ref- option is passed to the compiler by default. If any of your source files reference a class file that is not in your project and the file is out of date with its source, you will need to update the referenced class files. You can either recompile the external class files to make them up to date, add the external files to your project, or add the ref compiler option. You can add the ref compiler option by entering it in the Additional Compiler Options text box in the Compile tab of the Project Settings dialog box.

J5023 - File 'filename' has more than 65535 lines--debug information may be incorrect

The compiler attempted to place debugging information in a source file that contains more than 65535 lines of code. Your code may compile, however; not all the debugging code needed for your application will be contained in this file. Reduce the size of your source file so that the debugging information can be added and compile again.

J5024 - Package 'identifier' was already imported

The compiler detected a package imported more than once in the specified source file. Although this will not cause the compiler to fail, you should remove the extra import statement for the package specified in the warning message.

J5025 to J5499 – Not used

These error messages are currently not used.

J5500 - #warning 'user defined warning'

This warning message is generated when there is a #warning conditional compilation directive in the program.

The following example illustrates this error.

#define DEBUG
public class Simple{
   public void method1(){
      #if DEBUG
         #warning You are compiling for debug mode
         //warning: displayed when 'DEBUG' is defined
      #endif
   }
}

© 1999 Microsoft Corporation. All rights reserved. Terms of use.