I am sure this is a very newbie question, but writing Java app after years. I have written a simple java code to print "HelloWorld"
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println(" inside MAIN !!!");
}
Now I have created my project in eclipse & the structure is "/home/workspace/HelloWorld/src/com/android/test/helloworld/HelloWorld.java" & eclipse creates the .class at "/home/workspace/HelloWorld/bin/com/android/test/helloworld/HelloWorld.class". This runs successfully in Eclipse console. Now I want to run it though my Ubuntu 11.04 terminal.
If i cd upto the .class parent folder & use java .HelloWorld, it throws an ClassNotFoundException
Exception in thread "main" java.lang.NoClassDefFoundError: /HelloWorld
Caused by: java.lang.ClassNotFoundException: .HelloWorld
If I write the same prog with the source file & class file generated in the same default package, I am able to run it through the terminal.