Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

no classDefination Found Error

 
saikrishna cinux
Ranch Hand
Posts: 689
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

its very simple doubt

when i compile my java files it does fine but if i need to run the programme by this command ex: java test then it gives error

how to solve it sir

cinux
 
Timmy Marks
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is the name of your class "test" or "Test"? I would make sure that you are using the right class name and either launching java from the directory where the class lives, or that the class is in the classpath.
 
Philip Heller
author
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does your source file contain a package definition?

If so, you need to type "java package_name.class_name".

If not, as Timmy suggests, see if your class name is "test" or "Test". If it's "Test" then you need to type "java Test".

If your class name is "test", be aware that class names really should begin with upper-case letters. And make sure your classpath includes "."
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic