Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Exception in thread "main" java.lang.NoClassDefFoundError

 
Ashish Goradia
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I get this error

Exception in thread "main" java.lang.NoClassDefFoundError: ScreenView (wrong name: programm/ScreenViw)
where programm is the package and ScreenViw is the class
can u please inform me how do I rectify it
the class path is set to c:\prog
and this programm folder is under prog folder in c:\
also I can compile and also get the classes(java classes ) after compilation in the directory
i.e. I can compile
but not run
I dont know
please help
do it as soon as possible
Thanks and Regds,
 
Sam Dalton
Author
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ashish Goradia:
I get this error
I would think that you have your directory naming wron. Your file should be in a directory called programm. Your classpath should be set to the directory that holds the full package. If the case is incorrect this will not work..
S
Exception in thread "main" java.lang.NoClassDefFoundError: ScreenView (wrong name: programm/ScreenViw)
where programm is the package and ScreenViw is the class
can u please inform me how do I rectify it
the class path is set to c:\prog
and this programm folder is under prog folder in c:\
also I can compile and also get the classes(java classes ) after compilation in the directory
i.e. I can compile
but not run
I dont know
please help
do it as soon as possible
Thanks and Regds,

 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The package declarations are for use during execution. When you are first INVOKING an application the JVM doesn't know what package to look for the class in.
Whatever you are using to drive the application (the class with the main) MUST be in the direct classpath to get found.
Either change your class to be in the \prog directory or change you classpath to include the "current" directory by adding a dot reference (set CLASSPATH=.;c:\prog) and invoke the class from the programm directory or change your class path to include the programm subdirectory.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic