aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Class Not Found Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Class Not Found" Watch "Class Not Found" New topic
Author

Class Not Found

Michael Scott
Ranch Hand

Joined: Jan 20, 2003
Posts: 57
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

Joined: Aug 24, 2001
Posts: 348
Have you include the com.ibm.mdtom.crescomm into the CLASSPATH variable ?


not so smart guy still curious to learn new stuff every now and then
Robbie kyodo
Ranch Hand

Joined: May 05, 2003
Posts: 97
did u do a proper import com.ibm.....?


SCJP 2 1.4
Ryan Wilson
Ranch Hand

Joined: Apr 16, 2003
Posts: 65
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

Joined: Mar 29, 2003
Posts: 25
think you still need to import, like :
package a.b.c;
class k {}

another file
import a.b.c.k;
Ryan Wilson
Ranch Hand

Joined: Apr 16, 2003
Posts: 65
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

Joined: Aug 05, 2002
Posts: 787
So what is cause of this problem?
Barkat Mardhani
Ranch Hand

Joined: Aug 05, 2002
Posts: 787
So what is cause of this problem?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Class Not Found