Java Import Error
when I try and run a program in the Javelin Stamp manual I get this message:
Warning The public type "Countdown" does not match the name of the containing file "C:/Program Files/Parallax Inc/Javelin·Stamp IDE/Projects/Import.java"
[noparse][[/noparse]Error JVM-0017] Unable to load class file import
Here is the code I'm trying to run
import stamp.core.*;
public class Countdown {
· static int myVar;
· public staic void main() {
· System.out.println("message");
· CPU.delay(10000);
· for(myVar = 10; myVar >= 1; myVar--) {
· CPU.delay(2000);
··System.out.println(myVar);
· }
· System.out.println("message");
··}
}
Warning The public type "Countdown" does not match the name of the containing file "C:/Program Files/Parallax Inc/Javelin·Stamp IDE/Projects/Import.java"
[noparse][[/noparse]Error JVM-0017] Unable to load class file import
Here is the code I'm trying to run
import stamp.core.*;
public class Countdown {
· static int myVar;
· public staic void main() {
· System.out.println("message");
· CPU.delay(10000);
· for(myVar = 10; myVar >= 1; myVar--) {
· CPU.delay(2000);
··System.out.println(myVar);
· }
· System.out.println("message");
··}
}
Comments
So if you saved the file using CountDown.java
then you must use
public class CountDown
and not
public class Countdown for example.
Use windows explorer to see what the real name of the file is.
Also check if there is a file Import.java and if so, rename it because import
is a reserved word.
regards peter
Post Edited (Peter Verkaik) : 2/13/2008 6:04:47 AM GMT