i can't get a simple class to run on the command line. here's the class
//the file's name is a.java
public class a
{
public static void main(String a[])
{ System.out.println("Hello World!"); }
}
then, in the same directory as that file, i type:
javac a.java
java a.class
then, it spits me this error:
Exception in thread "main" java.lang.NoClassDefFoundError: a/class
i'm pretty sure i've done this before so it's probably something really stupid that i don't understand but i need help.
//the file's name is a.java
public class a
{
public static void main(String a[])
{ System.out.println("Hello World!"); }
}
then, in the same directory as that file, i type:
javac a.java
java a.class
then, it spits me this error:
Exception in thread "main" java.lang.NoClassDefFoundError: a/class
i'm pretty sure i've done this before so it's probably something really stupid that i don't understand but i need help.