Quantcast
Viewing all articles
Browse latest Browse all 54

How do I set up the path to the classes?

I'm running XP. The Java compiler doesn't know where the classes are like when you use the import statement.

For example

import java.io.*;
import java.lang.*;

I get the following errors:

error J0051: Undefined package 'io'
error J0051: Undefined package 'lang'

I look up the error number and this is the explanation:

Code:

Compiler Error J0051
Undefined package 'identifier'

The compiler detected a package name, but was unable to locate the package definition.
This error most likely occurs when a syntactical error exists in an import statement.
This error may also occur when the package cannot be found.

The following sample illustrates this error:




import java.lang.String.*;
// error: 'String' not a valid package name

public class Simple {
 
  // do something meaningful
 
}


Viewing all articles
Browse latest Browse all 54

Trending Articles