J0161 | J0162 | J0163 |
J0164 | J0165 | J0166 |
J0167 | J0168 | J0169 |
J0170 | J0171 | J0172 |
J0173 | J0174 | J0175 |
J0176 | J0177 | J0178 |
J0179 | J0180 |
The source file specified in the error message could not be opened. This error most likely occurs when either the filename specified is misspelled or the file does not exist. Check the location of the specified source file, and then compile again.
The compiler failed to properly initialize. Check to ensure the CLASSPATH environment variable is set properly, and then compile again.
The compiler detected access to an array type, but the index value was missing. To access an element of an array, you must provide a valid integer index for the array.
The following sample illustrates this error.
public class Simple { int j[] = {1, 2, 3}; void method1() { j[] = 0; // error: 'j' missing index value } }
The compiler detected two or more import statements attempting to import identical class names from different packages. This error most likely occurs when two packages contain duplicate classes and both packages are imported into the same source file. Check the packages imported into the source file for duplicate classes. Remove the duplicate class from one of the packages or remove one of the import statements from the source file.
The compiler detected an override method attempting to throw more exceptions than the method it overrides. In Java, an override method may not be declared to throw more exceptions than the overridden method. Either change the exception thrown to one that the base class throws, or change the base class declaration to throw the exception type that the subclass needs to throw.
The following sample illustrates this error.
class ExceptionA extends Exception ( // do something meaningful } class ExceptionB extends Exception { // do something meaningful } class AnotherClass { public void method1() throws ExceptionA { // do something meaningful } } public class Simple extends AnotherClass { public void method1() throws ExceptionA, ExceptionB { // error: cannot throw greater than // one exception here } }
The compiler detected an invalid attempt to reference a member variable defined within a different package. This error most likely occurs when an attempt is made to access a protected member defined within another package.
The compiler detected an attempt to override a superclass method with a subclass method declared with the modifier static. When a method is overridden in a subclass, the method cannot raise or lower the access level of the method or apply the static modifier. Remove the static modifier from the overridden method declaration, and then compile again.
The following sample illustrates this error.
public class Simple { public void method1() { // do something meaningful } } class Simple2 extends Simple { static public void method1() { // error: overriding superclass 'method1' // with a static method is not valid } }
The compiler detected a method declared with the modifier abstract within a class which was not defined as abstract. This error most likely occurs when a class was intended to be abstract but is missing the abstract modifier in the class declaration. Either change the class so it is declared as abstract or remove the modifier from the methods defined in the class.
The following sample illustrates this error.
public class Simple { abstract void method1(); // error: class must also be abstract }
The compiler detected an attempt to access a non-public class or interface contained within another package. Only classes or interfaces defined with the modifier public can be accessed in other packages. Check the access level of the class or interface you are accessing in the other package and ensure that it is public.
The compiler attempted to load a predefined class, but was unable to find the appropriate file. This error most likely occurs when the CLASSPATH variable has not been set correctly. Check to ensure the CLASSPATH is set properly, and then compile again.
This error message is currently not used.
This error message is currently not used.
The compiler found the specified class, but the class was not defined as a member of the correct package. This error most likely occurs when an import statement includes an incorrect package identifier for the class.
This error message is currently not used.
The compiler detected an attempt to call a method from the null keyword. Null is not a class object and provides no methods.
The compiler detected a nested label that was the same as another label. Rename the label to something different then change all break and continue statements that reference the label, and then compile again.
The following sample illustrates this error.
public class Simple{ void method1(){ outsideLoop: for (int i=0;i<10;i++) { outsideLoop: //error: duplicate label for (int x=0;x<10;x++) { break outsideLoop; } break outsideLoop; } } }
This error message is currently not used.
This error message is currently not used.
This error message is currently not used.
This error message is currently not used.