Exception in thread "main" java.lang.NoClassDefFoundError

Posted by Manu on Stack Overflow See other posts from Stack Overflow or by Manu
Published on 2010-03-24T10:11:48Z Indexed on 2010/03/24 10:13 UTC
Read the original article Hit count: 295

Filed under:

package pack;

public class sample{

public static void main(String input[]) {

    NumberFormat numberFormat = new DecimalFormat("#,##0.00##");
System.out.println(numberFormat.format(44533125.00));

} 

}

the code is working fine in the current dir.. (c:/myprogram/).

after that i copy the sample.class file and paste it in other dir(d:/myprogram). i got error while running, like

" Exception in thread "main" java.lang.NoClassDefFoundError: sample (wrong name: pack/sample)"

In java .class file can run anywhere right? but why i am not able to run?

© Stack Overflow or respective owner

Related posts about java