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

class file not running on jvm

 
kkailash
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

hi Friends
can some body tell why iam getting error while trying to run my
class File.
ERROR IS like NO CLASS DEFOUNDER
 
Ian Darwin
author
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A good general rule in using Java is that most of the error codes are condensations of English phrases. So the error message ArrayIndexOutOfBoundsException means that you had, obviously, an array index or subscript that was either negative, or greater than or equal to the length of the array. Similarly,
<pre>Exception in thread "main" java.lang.NoClassDefFoundError: PooBah</pre>
means that No Class Definition was Found with the name PooBah.
This usually means:

  • The class name is spelled incorrectly (and note that class names are case sensitive, even on MS-Windows; a class name is not the same thing as a file system entry, though it must usually be spelled and capitalized the same way);
  • The class is not in the current directory and your class path does not include the directory that it is in. Java's class path is similar to the execution PATH used for programs on both UNIX and MS-Windows, but it can be set either as an environment variable or on the command line.

  • Originally posted by kkailash:

    hi Friends
    can some body tell why iam getting error while trying to run my
    class File.
    ERROR IS like NO CLASS DEFOUNDER


    ------------------
    Ian Darwin,
    Author of Java Cookbook: Solutions and Examples for Java Developers
 
mitchner green
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In case you're not familiar with classpaths, try:
set CLASSPATH=%CLASSPATH%;.
or
set CLASSPATH=%CLASSPATH%;<Your directory>
That should do it.
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
kkailash,
Please change your name to be compliant with JavaRanch's naming policy.
Your ID should be 2 separate names with more than 1 letter each. We really want this to be a professional forum and would prefer that you use your REAL name.
You must have a valid registered name to qualify for the book give away.
Thanks,
Cindy
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic