• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Class Not Found

 
Michael Scott
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a program with two classes (CRAccess and CRWelcome). These classes are in two separate packages. As shown below, CRWelcome has a method called getCRAccess().

public class CRAccess {
}
public class CRWelcome {

private COM.ibm.mdtom.crescomm.CRAccess
getCRAccess() { }
}

When this method is called, the following error occurs:
java.lang.NoClassDefFoundError: CRAccess
However, the class CRAccess does exist in the package COM.ibm.mdtom.crescomm. I'm interested in what might be causing this error.
Thanks very much.
 
chi Lin
Ranch Hand
Posts: 348
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you include the com.ibm.mdtom.crescomm into the CLASSPATH variable ?
 
Robbie kyodo
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
did u do a proper import com.ibm.....?
 
Ryan Wilson
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Robbie if he is using the fully qualified path, would he have to do the import?
After all imports are just a shortcut for using the full path.
 
jioy uilo
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
think you still need to import, like :
package a.b.c;
class k {}

another file
import a.b.c.k;
 
Ryan Wilson
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What I was trying to say is that you can do it 2 ways.

He can do this


Or he could do it this way

It looks like Michael is using the fully qualified path so he should not have to use an import statement.
 
Barkat Mardhani
Ranch Hand
Posts: 787
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So what is cause of this problem?
 
Barkat Mardhani
Ranch Hand
Posts: 787
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So what is cause of this problem?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic