| Error | Solution |
|---|
| "Bad command or filename" | Did you spell everything right? If so, you [probably have not set your PATH environment variable correctly and the computer cannot find the javac or java virtual machine executable. Either set your path correctly, or referencethe executable exactly with something like: C:\Java\Sun\jdk1.1.4\Bin\javac Test.java |
| "ClassDefNotFound Error" | You have not defined your CLASSPATH correctly and the java compiler cannot find the java class library it needs in order |
| "Public class Test must be defined in a file called 'Test.java'" | You have to be careful about case-sensitivity when programming in Java. You probablytyped "javac test.java." Try typing the javac command again with a capital "T" |
| "Can't find class Test/class" | You were probablytrying to execute your compiled test class and typedjava Test.class. You should not use the .class extension. Try typingjava Test |
| "Can't find class test" | Case sensitivity again!You probably typed "java test" and it should be "java Test" |
| "Test.java:7: ';' expected". | You forgot to end that line with a semi-colon |
| "Return required at end of java.lang.String getAnnouncement()" | You forgot to sayreturn _announcement; at the end of this method. Remember that if you say you are going to return something,you have to do it. |
| "Announcer.java:22: Undefined variable: _announcement" | In this case, _announcement is spelled wrong.However, it could also mean that you have defined the_announcement variable in a method that is not accessible.Remember that if you want variables to be available to other methodsin the same class, you must declare them outside of the method. |