Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Fern Sanchez   on May 05 In Java Category.

  
Question Answered By: Lurlene Fischer   on May 05

When you run  "java Prog1", java  search for a class  named "Prog1" in its class
path (usually current directory), not for a file  named "Prog1" or "Prog1.class".

But when you run "java Prog1.class", java search for a class named "class" in
"Prog1" package in its class path. There's no such class that why  it returns
NoClassDefFoundError.

Share: