JVC Error and Warning Messages |
![]() Welcome! |
This page contains a listing of all JVC Errors and Warning Messages produced by this compiler.
J5001 | J5002 | J5003 | J5004 | J5005 | J5006 | J5007 | J5008 | J5009 |
The compiler was unable to recover after detecting an error. If you receive this message, consult your technical support help file for information on how to address this problem.
The compiler attempted to allocate some additional memory during processing, but was unable to do so. When this error occurs, check the location, size and validity of your system swap file. Also, check that there is sufficient growth space available on the drive on which your swap file resides.
The compiler may have detected generation of invalid code. Try dividing larger methods defined within your classes into smaller methods and compiling again.
The compiler could not open the program source file for reading. This error most likely occurs when another program has an exclusive lock on the source file. Try shutting down other processes that may be accessing the source file and compiling again.
The compiler failed to generate the output .CLASS file. This error most likely occurs when the compiler cannot get write or create permission for the file. Make sure the file does not have its read-only attribute set, and that it is not currently in use by another process.
The compiler failed to read the specified .CLASS file. This error most likely occurs when the compiler encounters an error reading the storage device, or when the compiler cannot otherwise get read permission for the file. Check to ensure the file is not currently in use by another process. Also, use whatever means available (i.e. SCANDISK) to ensure the validity of the storage device you are attempting to use.
The compiler failed while attempting to write the contents of a buffer to the specified .CLASS file. This error most likely occurs when space is exhausted on the targeted storage device. Try freeing up any available space on the storage device and compiling again.
The compiler could not locate a core language class for the java.lang package. This error most likely occurs when the Java CLASSPATH variable is not properly set . Try correcting the CLASSPATH variable, and compiling again.
This error message is currently not used.
The compiler could not determine the meaning of an expression or statement within the source program. This error most likely occurs when the line indicated in the error message is syntactically invalid. This error usually accompanies a more descriptive error. Try correcting any accompanying errors and compiling again.
The following sample illustrates this error:
public class Simple { public void method1() { int i =; // error: initialization error } }
The compiler expected to find a colon following a case label or in a conditional expression that makes use of the ternary operator. This error most likely occurs when the colon is accidentally omitted.
The following sample illustrates this error:
public class Simple { private int i; private static int x = 1; public void method1(int arg1) { switch (arg1) { case 1 // error: ':' omitted ; // do something meaningful } i = ( arg1 < x) ? arg1 x; // error: ':' omitted } }
The compiler expected to find a semicolon in the position indicated by the error message. This error most likely occurs when the semicolon is accidentally omitted from the end of a statement. This error can also occur when a conditional expression is not syntactically correct.
The following sample illustrates this error:
public class Simple { private static int x = 10 // error: ';' omitted public void method1(int arg1) { for (int i = 1; i < x i++) { // error: ';' omitted ; } } }
The compiler expected to find a left parenthesis in the position indicated by the error message. This error most likely occurs when the left parenthesis is accidentally omitted in any of the following situations:
public class Simple { private int i; public void method1(int arg1, int arg2) { if arg1 < arg2) // error: '(' omitted i = arg1; else i = arg2; } }
The compiler expected to find a right parenthesis in the position indicated by the error message. This error most likely occurs when the right parenthesis is accidentally omitted in any of the following situations:
public class Simple { private int i; public void method1(int arg1, int arg2) { i = (arg1 < arg2 ? arg1 : arg2; // error: ')' omitted } }
The compiler expected to find a right square bracket in the position indicated by the error message. This error most likely occurs when the right square bracket is accidentally omitted from an array declaration.
The following sample illustrates this error:
public class Simple { private int x[ = new int[500]; // error: ']' omitted }
The compiler expected to find a left brace in the position indicated by the error message. This error most likely occurs when the left brace is accidentally omitted from the beginning of a class declaration.
The following sample illustrates this error:
public class Simple // error: '{' omitted public void method1() { // do something meaningful } }
The compiler expected to find a right brace in the position indicated by the error message. This error most likely occurs when a statement containing a right brace is not syntactically correct.
The following sample illustrates this error:
public class Simple { public void method1() { int arr[] = {1, 2A}; // error: invalid initialization } }
The compiler expected to find the keyword while in the position indicated by the error message. This error most likely occurs when a do/while loop is not syntactically correct. The correct structure for a do/while loop is:
do { // do something useful here } while (condition);
The compiler expected to find an identifier toward the end of a class, interface, variable, or method declaration. This error most likely occurs when the type is accidentally omitted in a declaration.
The following sample illustrates this error:
public class Simple { private i; // error: type omitted }
The compiler expected to find either class or interface used within the corresponding declaration. This error most likely occurs when the keywords are accidentally omitted from a class or interface declaration. Another possible cause of this error is unbalanced scoping braces.
The following sample illustrates this error:
public class Simple { // do something meaningful }} // error: additional '}' is the problem
The compiler expected to find a type specifier in the position indicated by the error message.
The compiler expected to encounter an end of file character, but did not. This error most likely occurs when the source file has been damaged in some way. Try visually checking the source file for obvious corruption, save any changes and compile again.
The compiler expected to find a catch or finally block immediately following a corresponding try block.
The following sample illustrates this error:
public class Simple { public void method1( ) { try { // do something meaningful } } // error: 'catch' or 'finally' not found }
The compiler expected to find a method body immediately following a method declaration. This error most likely occurs when the braces surrounding the method body are not properly balanced. This error may also occur when the method was intended to be abstract, but the abstract keyword was mistakenly omitted from the method declaration.
The following sample illustrates this error:
public abstract class Simple { public void method1( ); // error: 'abstract' omitted }
The compiler expected to find a statement before the end of the current scope. This error most likely occurs when the right brace designating the end of the current scope is misplaced.
The following sample illustrates this error:
abstract class Simple { void method1() { if (1) // error: a statement is required // after the if statement } }
The compiler expected to find a valid Unicode escape sequence. This error most likely occurs when a syntactical error is found in a Unicode escape sequence.
The following sample illustrates this error:
public class Simple { int i = \\u0032; // error: '\\' not invalid }
The compiler detected an identifier name with a length greater than 1024 characters. Shorten the identifier name and compile again.
The compiler detected a numeric value that the Java language is not capable of supporting. This error most likely occurs when the number specified is an amount greater than any of Java's primitive types can accept.
The following sample illustrates this error:
public class Simple { long i = 12345678901234567890; // error: value out of range }
The compiler detected an ASCII character that could not be used in an identifier. This error most likely occurs when a class, interface, method, or variable identifier includes an invalid character.
The following sample illustrates this error:
public class Simple { private int c#; // error: '#' not supported }
The compiler detected an attempt to assign an invalid character or character escape sequence to a variable of type char.
The following sample illustrates this error:
public class Simple { char c = '\'; // error: invalid escape character }
The compiler detected the use of an invalid escape character. This error most likely occurs when a syntactical error is found in a Unicode escape sequence.
The following sample illustrates this error:
public class Simple { int i = \u032; // error: Unicode uses 4 hex digits }
The compiler did not detect a terminating double-quote character at the end of a string constant. This error most likely occurs when the string terminator is accidentally omitted, or when the string constant is mistakenly divided onto multiple lines.
The following sample illustrates this error:
public class Simple { String str = "Hello // error: '"' and ';' omitted }
The compiler detected the beginning of a block comment, but did not detect a valid ending for it. This error most likely occurs when the comment terminator is accidentally omitted.
The following sample illustrates this error:
public class Simple { /* This comment block * does not have a valid * terminator }
This error message is currently not used.
The compiler detected a possible static initializer block, but did not detect the keyword static immediately preceding it. This error most likely occurs when the keyword static is accidentally omitted. This error may also occur when some other syntactical error exists.
The following sample illustrates this error:
public class Simple { static private int i; { // error: 'static' omitted i = 1; } }
The compiler detected one of the modifiers shown above used in the declaration of a variable. The modifiers synchronized and native can only be applied to method declarations. The abstract modifier can be applied to methods, classes, and interfaces.
The compiler detected one of the modifiers shown above used in the declaration of a method. The modifiers transient and volatile can only be applied to variable declarations.
The compiler detected an uninitialized final variable. Variables declared as final must have their value set at declaration. Once set, the value cannot be programmatically changed.
The following sample illustrates this error:
public class Simple { private final int MAX_HEADROOM; // error: must have value set }Note that variables declared within interfaces are implicitly defined as final or static. As such, this error also occurs when their initial values are not set at declaration.
This error message is currently not used.
The compiler detected a method body defined immediately following the corresponding declaration of an abstract or native method.
The following sample illustrates this error:
public interface Simple { public void method1() { // error: must define this method body // in a class that implements the // 'Simple' interface } }Note that methods declared within an interface are implicitly abstract. As such, this error will also occur when you attempt to define their body in an interface.
The compiler detected a modifier used twice in a declaration. This error most likely occurs when the same modifier is mistakenly used more than once within a declaration.
The following sample illustrates this error:
public class Simple { public public void method1() { // error: 'public' used twice // do something meaningful } }
The compiler detected an interface declaration using the implements keyword. Interfaces cannot implement other interfaces. Rather, interfaces may only be implemented by classes.
The following sample illustrates this error:
public interface Simple implements color{ // error: 'Simple' cannot implement the // 'color' interface } interface color { // do something meaningful }
The compiler detected the same identifier name being declared more than once within the same scope. This error most likely occurs when a variable is mistakenly declared more than once.
The following sample illustrates this error:
public class Simple { private int i; private int i; // error: 'i' declared twice }
The compiler could not locate the definition for the specified class. This error is most likely caused by a typographical error. It may also occur when the package containing the specified class cannot be found.
The following sample illustrates this error:
public class Simple { char buf[] = new chaar[5]; // error: 'chaar' not a valid type }
The compiler detected one of the following conditions:
The following sample illustrates this error:
package non.existent; import non.existent; // error: public class Simple { // do something meaningful }
The compiler detected that the identifier referred to by the keyword implements is not an interface.
The following sample illustrates this error:
class Simple2 { // do something meaningful } public class Simple implements Simple2 { // error: cannot implement class 'Simple2' }
The compiler detected an invalid package name. This error most likely occurs when a syntactical error exists in an import statement, or when the package name does not otherwise exist.
The compiler detected an attempt to subclass a class declared with the keyword final. Classes declared as final cannot be subclassed.
The following sample illustrates this error:
final class Simple2 { // do something meaningful } public class Simple extends Simple2 { // error: cannot extend 'Simple2' }
The compiler detected an unknown class name while processing an import statement. This error most likely occurs when the identifier is misspelled or does not exist. This error may also occur if the CLASSPATH variable is not set correctly.
The following sample illustrates this error:
import java.io.bogus; // error: unknown class name public class Simple { // do something meaningful }
The compiler detected a reference to an identifier that is not a member of the specified package. This error most likely occurs when the identifier is misspelled or does not exist.
The following sample illustrates this error:
public class Simple { public void method1() { java.lang.bogus.method1(); // error: 'bogus' not member of 'lang' } }
The compiler detected a package name, but was unable to locate the package definition. This error most likely occurs when a syntactical error exists in an import statement. This error may also occur when the package cannot be found.
The following sample illustrates this error:
import java.lang.String.*; // error: 'String' not a valid package name public class Simple { // do something meaningful }
This error message is currently not used.
The compiler could not resolve an ambiguity between the two identifiers shown. Correct the ambiguity between the two types and compile again.
The compiler detected two or more method overloads having identical parameters. In Java, overloaded methods must be distinguished by unique signatures. A unique signature consists of the method name, the number, type and positions of its parameters, and the return type.
The following sample illustrates this error:
public class Simple { public int method1(int arg1, char arg2) { // do something meaningful return arg1; } public char method1(int arg3, char arg4) { // error: identical parameters return arg4; } }
The compiler detected a constructor declaration specifying a return type. Constructors must implicitly return an instance of the declared class. As such, their return type may not be specified.
The following sample illustrates this error:
public class Simple { int Simple() { // error: return type specified return 1; } }
The compiler detected a method declaration without a return type specified. All method declarations must specify a return type. If the method is not meant to return a value, use the void keyword.
The following sample illustrates this error:
public class Simple { public method1() { // error: no return type // do something meaningful } }
The compiler did not detect the class name shown above within the specified file. This error most likely occurs when the class name is either misspelled or does not exist. This error may also occur when a .CLASS file has been renamed after successful compilation.
The compiler detected a variable declared as type void. The keyword void is not allowed in variable declarations. Rather, void can only be used as a method return type, noting that the method does not actually return a value.
The following sample illustrates this error:
public interface Simple { public final static void i = 1; // error: 'void' not valid }
The compiler detected an attempt to reference a variable without a known object association. This error most likely occurs when an instance variable (a variable declared without the keyword static) is referenced from within a class (or static) method.
The following sample illustrates this error:
public class Simple { private int x; public static void method1() { x = 0; // error: 'x' must be static } }
The compiler detected an attempt to initialize a variable with another variable that had not yet been defined.
The following sample illustrates this error:
public class Simple { private static int i = j; // error: 'j' not yet defined private static int j = 0; }
The compiler detected a subclass method attempting to overload a base class method, but the methods differed only in return type. In Java, overloaded methods must be distinguished by unique signatures. A unique signature consists of the method name, the number, type and positions of its parameters, and the return type.
The following sample illustrates this error:
public class Simple extends Simple2 { public void method1() { // error: only return type differs } } class Simple2 { public int method1() { return 1; } }
The compiler detected an overloading method in the class being compiled that reduces the access level of its base class method.
The compiler detected the declaration of an abstract method within a class, but the class was not declared to be abstract.
The following sample illustrates this error:
public class Simple { public abstract void method1(); // error: class not abstract }
The compiler detected two or more variables with the same identifier defined within the same scope of a method.
The compiler detected an expression in the position normally held by an lvalue for assignment.
The following sample illustrates this error:
public class Simple { public void method1() { int x = 0; int y = 1; x++ = y; //error: '++' not valid } }
The compiler detected use of the keyword this within a class (or static) method. Class methods are not passed implicit this references. As such, they cannot reference instance (non-static) variables or methods.
The following sample illustrates this error:
public class Simple { int x; public static void method1() { this.x = 12; // error: 'this' instance specific } }
The compiler detected a variable type used out of its correct context. As such, the compiler could not implicitly convert the result to anything meaningful.
The following sample illustrates this error:
public class Simple { public void method1() { int i = 10; if (i--) { // error: conditional needs expression // or boolean variable } } }
The compiler could not convert the specified variable without an explicit type cast.
The following sample illustrates this error:
public class Simple { int i = 10; public char method1() { return i; // error: expected type char } }
The compiler detected the '.' operator applied to an invalid type. This error most likely occurs when the .length method is applied to an invalid type.
The following sample illustrates this error:
public class Simple { int i = 123; int j = i.length; // error: 'i' not an array }
The compiler detected syntax for a known method call, but did not detect an associated argument list. This error most likely occurs when a syntactical error exists in the call.
The following sample illustrates this error:
public class Simple { public static void main(String args[]) { System.out.println = ("Hello"); // error: '=' invalid } }
The compiler detected syntax for a method call, but the identifier found could not be a method. This error most likely occurs when a method name is misspelled and matches a variable name.
The following sample illustrates this error:
class Simple { int x; int y = x(); //error: x is not a method }
The compiler detected a method call, but the method remains undefined. This error most likely occurs when the method name is either misspelled, or cannot be found within proper scope. This error may also occur when the method does not exist.
The following sample illustrates this error:
public class Simple { public static void main(String args[]) { System.out.printline("Hello"); // error: 'printline' should be 'println' } }
The compiler detected an invalid attempt to access a class member within a different package. Correct the visibility of the member being accessed and compile again.
The compiler detected an operator that cannot be correctly applied to the identifiers shown in the error message.
The following sample illustrates this error:
public class Simple { public void method1() { String s1 = "one"; String s2 = "two"; String result; result = s1 * s2; // error: invalid operands } }
The compiler detected syntax for a method call, but the identifier does not represent a valid method name. This error most likely occurs when a method name is misspelled or contains characters that are not recognized as valid in Java naming conventions.
The following sample illustrates this error:
class Simple { int x = 1(); //error: 1 is not a valid method name }
The compiler detected a known method call, but the call contained more arguments than needed.
The following sample illustrates this error:
public class Simple { public void method1(int arg1) { // do something meaningful } public void method2() { method1(1, 2); // error: Too many arguments } }
The compiler detected a known method call, but the call contained fewer arguments than needed. This error most likely occurs when one or more arguments are accidentally omitted from the call.
The following sample illustrates this error:
public class Simple { public void method1(int arg1) { // do something meaningful } public void method2() { method1(); // error: Too few arguments } }
The compiler identified a call to a known overloaded method within another class, but was unable to detect a matching method with the correct number of arguments.
The following sample illustrates this error:
public class Simple { public void method1() { // do something meaningful } public void method1(int arg1) { // do something meaningful } } class Simple2 { public void method1() { Simple s = new Simple(); s.method1(1, 2, 3); // error: too many args } }
The compiler could not distinguish the correct method to execute. This error most likely occurs when the method parameters specified in a call do not exactly match any of those defined within the called methods declaration, or any of its base classes.
The following sample illustrates this error:
public class Simple { static void method1(Simple2 s2, Simple3 s3) { // do something meaningful } static void method1(Simple3 s3, Simple2 s2) { // do something meaningful } public static void main(String args[]) { Simple2 s2 = new Simple2(); method1(s2, s2); // error: Ambiguity between Simple2 and Simple3 } } class Simple2 extends Simple3 { // do something meaningful } class Simple3 { // do something meaningful }
The compiler detected a method argument that does not match the parameters specified in the method declaration.
The following sample illustrates this error:
public class Simple { public void method1(int arg1) { // do something meaningful } public void method2() { float f = 1.0f; method1(f); // error: mismatched call types } }
The compiler detected a method call, but was unable to convert one of the arguments from the supplied type to the type shown in the method declaration. This error most likely occurs when a method is called with the arguments in the wrong order, or the wrong method was called.
The compiler did not detect a constructor matching the call identified in the error. This error most likely occurs when a constructor is called with the wrong number of arguments.
The following sample illustrates this error:
public class Simple { Simple(int arg1) { // do something meaningful } public static void main (String args[]) { Simple s = new Simple(12, 13); // error: too many arguments } }
The compiler detected use of the keyword super within a method. This keyword can only be used within a constructor.
The following sample illustrates this error:
public class Simple { public void method1 () { super(); // error: 'super' cannot be called } }
The compiler detected an attempt to return a value from a method declared with a return type of void.
The following sample illustrates this error:
public class Simple { public void method1() { return 1; // error: cannot return a value } }
The compiler detected the keyword return within the body of a method which was declared to return a specific type, but the return had no associated value.
The following sample illustrates this error:
public class Simple { public int method1() { return; // error: must return int value } }
The compiler detected array brackets used with a non-array variable type.
The following sample illustrates this error:
public class Simple { public void method1() { int i = 0; int j, x; x = j[i]; // error: 'j' not declared as array } }
The keyword goto, while defined as a keyword, has not yet been implemented in the Java language.
This error message is not currently used.
The compiler identified two or more case statements with the same identifier or value occuring within the same switch statement.
The following sample illustrates this error:
public class Simple { public int method1(int arg1) { switch (arg1) { case 1: return (int) 1; case 2: return (int) 2; case 2: // error: duplicate of above return (int) 3; default: return (int) 0; } } }
The compiler identified two or more instances of the keyword default occuring within the same switch statement.
The following sample illustrates this error:
public class Simple { public int method1(int arg1) { switch (arg1) { case 1: return (int) 1; case 2: return (int) 2; default: return (int) 3; default: // error: duplicate of above return (int) 0; } } }
The compiler identified the keyword case used outside the scope of a switch statement.
The following sample illustrates this error:
public class Simple { public int method1() { case 1: // error: no switch statement return 1; } }
The keyword const, while defined as a keyword, has not yet been implemented in the Java language.
The following sample illustrates this error:
The compiler detected the keyword break occuring outside the scope of a loop or switch statement.
The compiler detected a label name associated with one of the keywords continue or break, but could not find the label.
The compiler detected attempted use of the keyword continue outside the scope of a loop.
The compiler detected a synchronization block, but the synchronized modifier was applied to an invalid type.
The following sample illustrates this error:
public class Simple { public void method1() { int i; synchronized (i); // error: 'i' must resolve to // class or array type } }
The compiler detected the instanceof operator applied to a type that did not resolve to a class or array.
The following sample illustrates this error:
public class Simple { public void method1() { Simple2 obj = new Simple2(); if (obj instanceof int) // error: bad type ; // do something meaningful } } class Simple2 { // do something meaningful }
The compiler detected an array member specified, but could not identify it.
The following sample illustrates this error:
public class Simple { public void method1() { int j[] = new int[10]; int i = j.bogus; // error: 'bogus' not valid member } }
This error message is currently not used.
The compiler detected an object in a throw statement that was not derived from the class Throwable.
The compiler detected an invalid class argument used as an argument in a catch declaration.
The following sample illustrates this error:
public class Simple { public void method1() { try { // do something meaningful } catch (String s) { // error: 'String' not a subclass // of 'Throwable' } } }
The compiler detected an exception handler that will never be executed because an earlier handler would have already caught the exception. This error is most likely caused by putting catch statements in the wrong order.
The following sample illustrates this error:
class Simple { static { try { } catch (Exception e) { } catch (ArithmeticException e) { } // error: any exceptions this block // could have caught are already caught // by the first catch statement. } }
The compiler detected a class method attempting to override one of its base class methods, but the base class method was declared with the keyword final.
The following sample illustrates this error:
public class Simple extends Simple2 { public void method1() { // error: 'method1' final in superclass } } class Simple2 { public final void method1() { // do something meaningful } }
The compiler detected a statement or declaration that cannot be reached under any circumstances.
The following sample illustrates this error:
class Simple { static { return; int x; //error: the declaration cannot be reached } }
The compiler detected a method declaration which included a return type other than void, but the keyword return was not found in the method body.
The following sample illustrates this error:
public class Simple { public int method1(int arg1) { } // error: expected an integer returned }
The compiler detected two or more classes directly or indirectly attempting to subclass each other.
The following sample illustrates this error:
public class Simple extends Simple2 { // error: extending 'Simple2' } class Simple2 extends Simple { // error: also extending 'Simple' }
The compiler detected the initialization of an array, but failed to detect a valid array dimension.
The following sample illustrates this error:
public class Simple { public void method1() { int [][] i = new int[][12]; // error: missing first array dimension } }
The compiler detected an attempt to instantiate a data type that does not require use of the keyword new.
The following sample illustrates this error:
public class Simple { public void method1() { int i = new int(5); // error: cannot use 'new' on 'int' types } }
The compiler detected an attempt to instantiate a class object declared as abstract.
The following sample illustrates this error:
public class Simple { public void method1() { Simple2 s2Object = new Simple2(); // error: class 'Simple2' declared as abstract } } abstract class Simple2 { // do something meaningful }
The compiler detected an attempt to instantiate an interface object declared as abstract. Note that interfaces are abstract by default, regardless whether the keyword abstract is used in their declaration.
The following sample illustrates this error:
public class Simple { public void method1() { Simple2 s2Object = new Simple2(); // error: interface Simple2 is abstract } } interface Simple2 { // do something meaningful }
The compiler detected an attempt to initialize an array, but the initialization statement was not syntactically correct.
The compiler detected an attempt to change the value of a variable declared as final.
The following sample illustrates this error:
public class Simple { private final int i = 3; public void method1(int arg1) { i = arg1; // error: variable 'i' declared final } }
The compiler detected a constructor called from within the body of a second constructor, but the constructor call was not placed at the beginning of the second constructor body.
The following sample illustrates this error:
public class Simple { int i, j; Simple () { i = 0; } Simple(int arg1) { j = arg1; this(); // error: call to Simple() must be first } }
The compiler detected a reference to this in a constructor. As the object has not been fully created while in the constructor, references to this are illegal in constructors.
The following sample illustrates this error:
class SuperSimple { SuperSimple(Object o) { } } public class Simple extends SuperSimple { Simple() { super(this); //error: cannot refer to this in constructor } }
The compiler detected a recursive constructor call.
The following sample illustrates this error:
public class Simple { Simple (int arg1) { this(1); // error: constructor calling itself } }
The compiler detected an attempt to use a variable before it was properly initialized.
The following sample illustrates this error:
public class Simple { static { int i; int j = i; // error: 'i' not yet initialized } }
The compiler detected use of the modifier private in a class declaration. This modifier may only be used with variables and methods.
The following sample illustrates this error:
private class Simple { // error: a class cannot be 'private' }
The compiler detected more than 256 local variables defined within a method. Try reducing the number of variables local to the method and compile again.
The compiler could not support the number of instructions local to a particular method. Try reducing the code in your larger methods by dividing them into smaller, more general purpose methods, and compile again.
The compiler detected a division by zero error in code.
The following sample illustrates this error:
public class Simple { final int x = 0; int y = 1 % x; //error: x cannot be 0 }
The compiler encountered a serious error and could not continue processing the file reliably. Try fixing whatever errors are already flagged and compile again.
The compiler detected an exception that was thrown but never caught within the exception class.
The following sample illustrates this error:
class SimpleException extends Exception { // do something meaningful } class Simple { void method1() throws SimpleException { } void method2() { method1(); } // error: exception not declared for method2 }
The compiler detected a class attempting to apply the keyword extends to more than one base class. This is defined as multiple inheritance in other languages, and is not supported in Java.
The following sample illustrates this error:
public class Simple extends BaseClass1, BaseClass2 { // error: Multiple inheritance not supported in Java } class BaseClass1 { // do something meaningful } class BaseClass2 { // do something meaningful }
The compiler detected an operator being applied to a type it cannot be used with.
The following sample illustrates this error:
public class Simple { void method1(boolean b) { b++; // error: post increment operator cannot // be applied to boolean variables } }
The compiler detected a finally block but did not find a corresponding try statement.
The following sample illustrates this error:
public class Simple { public void method1() { finally { // error: missing corresponding 'try' } } }
The compiler detected a catch block but did not find a corresponding try statement.
The following sample illustrates this error:
public class Simple { public void method1() { catch { // error: missing corresponding 'try' } } }
The compiler detected the keyword else but did not find a corresponding if statement.
The following sample illustrates this error:
public class Simple { public void method1() { else // error: no corresponding 'if' ; } }
The compiler detected an interface declared with the keyword final.
The following sample illustrates this error:
final interface Simple { // error: 'final' only applies to // classes, methods or variables }
The compiler detected a class declared with the keywords abstract and final.
The following sample illustrates this error:
public abstract final class Simple { // error: 'abstract' and 'final' cannot // be used together in a class declaration }
The compiler detected one of the keywords shown above used in the declaration of an interface method.
The following sample illustrates this error:
interface Simple { public final void method1(); // error: 'method1' cannot be declared // as final in an interface }
The compiler detected the use of two or more incompatible modifiers in the declaration of a method.
The following sample illustrates this error:
public class Simple { public private void method1() { // error: modifiers 'public' and 'private' // cannot be combined in a declaration } }
The compiler detected the use of two or more incompatible modifiers in the declaration of a variable.
The following sample illustrates this error:
public class Simple { public private int i; // error: modifiers 'public' and 'private' // cannot be combined in a declaration }
The compiler detected the use of one of the modifiers shown above in the declaration of a constructor.
The following sample illustrates this error:
public class Simple { final Simple() {} // error: constructors cannot be 'final' }
The compiler detected an interface containing a constructor declaration.
The following sample illustrates this error:
interface Simple { Simple(); // error: interfaces cannot // declare constructors }
The compiler detected one of the modifiers shown above used in the declaration of a interface member variable.
The following sample illustrates this error:
interface Simple { volatile int i = 1; // error: 'volatile'cannot be used. }
The compiler detected more than one class declared with the modifier public in a source file.
The following sample illustrates this error:
public class Simple { // do something meaningful } public class Errorclass { // error: only one class may be defined as // 'public' within the same source file }
The compiler detected an unsupported system code page. Refer to your Operating System manual for instructions on changing the system code page.
The compiler detected a static initializer within an interface.
The following sample illustrates this error:
interface Simple { static { // error: static initializers cannot // be used in interfaces } }
The compiler detected an invalid label.
The following sample illustrates this error:
public class Simple { public void method1() { 123: // error: label cannot // begin with alphanumeric return; } }
The compiler detected an attempt to override a static method from within a subclass.
The following sample illustrates this error:
public class Simple { static void method1() {} } class SimpleSubclass extends Simple { void method1() {} // error: cannot override // static method }
The compiler detected a method argument defined as type void.
The following sample illustrates this error:
public class Simple { public void method1(void i) { // error: type void can only // be used as a return value } }
The compiler detected an attempt to directly call an abstract method.
The following sample illustrates this error:
abstract class Simple { abstract int method1(); } class SimpleSubclass extends Simple { int method1() { return super.method1(); // error: 'method1' must be // implemented instead } }
The compiler detected an attempt to throw an exception from within a static initializer.
The following sample illustrates this error:
public class Simple { static { ThrowClass TClass = new ThrowClass(); // error: cannot throw exceptions // within static initializers } } class ThrowClass { ThrowClass() throws Exception{} }
The compiler could not locate a definition for the named interface.
The following sample illustrates this error:
public class Simple implements Bogus { // error: the interface 'Bogus' does not exist }
The output directory exceeded 228 characters in length. Try shortening the length of the output directory path and compile again.
The output directory could not be created. This error most likely occurs when you do not have write permission on the specified drive.
The compiler detected an invalid attempt to access a private member contained within another class.
The following sample illustrates this error:
public class Simple { public void method1() { AccessClass ac = new AccessClass(); ac.i = 1; // error: cannot access 'i' } } class AccessClass { private int i = 0; }
The compiler detected an attempt to reference an instance method before the superclass constructor was called.
The following sample illustrates this error:
abstract class Simple { Simple(int i) {} int method1() { return 0; } } class SimpleSubclass extends Simple { SimpleSubclass() { super(method1()); // error: constructor must be called first } }
The compiler detected an invalid conversion during an assignment.
The following sample illustrates this error:
public class Simple { char c = 65536; // error: char type only supports //>= 0 and <= 65535 }
The compiler detected an interface name being repeated within a class declaration.
The following sample illustrates this error:
interface SimpleI { // do something meaningful } class Simple implements SimpleI, SimpleI { // error: 'SimpleI' repeated }
The compiler detected two variables with the same name defined twice within the same scope of a method.
The following sample illustrates this error:
public class Simple { public void method1() { int i = 1; int i = 0; // error: 'i' defined twice within // the same scope } }
The compiler detected an ambiguous reference to an identifier. The identifier may have been declared in two or more interfaces, and the compiler could not determine which reference to use.
The following sample illustrates this error:
interface Interface1 { final int i = 0; } interface Interface2 { final int i = 1; } public class Simple implements Interface1, Interface2 { int method1() { return i; } }
The compiler failed to load the specified type library. This error most likely occurs in any of the following situations:
The compiler failed to retrieve a type library's attributes. This error most likely occurs in any of the following situations:
The compiler failed to retrieve the type library's name. This error most likely occurs in any of the following situations:
The compiler failed to load the specified library. This error most likely occurs in any of the following situations:
The compiler could not load the specified type from the library shown. This error most likely occurs in any of the following situations:
The compiler detected two or more classes defined with the same name.
The following sample illustrates this error:
public class Simple { // do something meaningful } class Simple { // error: class 'Simple' already defined }
The compiler detected the @ character on the JVC command line, but did not detect a valid response file name immediately following it. Supply the response file name and compile again.
The compiler could not open the specified response file. This error most likely occurs when the response file name is misspelled or the file does not exist.
The source file specified in the error message could not be opened. This error most likely occurs when either the file name specified is misspelled or the file does not exist.
The compiler failed to properly initialize. Check to ensure the CLASSPATH variable is set properly and compile again.
The compiler detected access to an array type, but the index value was missing.
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.
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.
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.
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.
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.
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.
The compiler could not load the specified type from the library shown. This error most likely occurs in any of the following situations:
The compiler could not load the specified type from the library shown. This error most likely occurs in any of the following situations:
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.
The compiler detected an initialized variable that was never referenced in any class code. This message occurs at warning level 3 or greater.
The following sample illustrates this warning:
public class Simple { public int method1() { int i = 1; return 1; // warning: 'i' is never used } }
The compiler detected an unsupported command line option specified.
The compiler detected an unknown option specified on the JVC command line. This warning most likely occurs when a typographical error exists. For example, specifying /W4 on the command line will cause this warning because the warning level option must use a lower-case 'w'.
The compiler detected a valid command line option, but the required argument was not specified.
The compiler detected an import statement for a package that was already implicitly imported, such as java.lang. This message occurs at warning level 1 or greater.
The compiler detected use of the modifier combination private protected. This combination is now obsolete and has been replaced by protected. This message occurs at warning level 1 or greater.
The compiler detected an assignment conversion problem that, while invalid according to the current Java language specification, must be supported for compatibility with the Sun class libraries. This message occurs at all warning levels.
The following sample illustrates this warning:
public class Simple { public void method1() { short s = 5; int i = 50000; long l = 5000000; s += i; // warning: non-standard assignment s += l; // warning: same as above i += l; // warning: same as above } }
JavaTLB detected a method with a parameter or return value that cannot be safely represented in Java.
Some of the data types that can generate this error are:
JavaTLB detected a method with a parameter or return value that is not supported for a dispatch interface. This includes parameters or return values of type LPSTR or LPWSTR. (Automation interfaces typically use the BSTR data type to represent strings.)
If the method was declared in a dual interface, the method is converted so that you can call the v-table version. If the method was declared in a dispatch-only interface, the method is not converted.
© 1997 Microsoft Corporation. All rights reserved. Legal Notices.