Previous | Next | Trail Map | Getting Started | Common Problems (and Their Solutions)

Compilation Problems

Here are the most common problems that you might encounter when compiling a program that uses the JNDI classes.

Class or Package Not Found

Problem: You get "Package javax.naming not found" or a similar error complaining about missing classes.

Cause: You did not include the JNDI classes (jndi.jar) in your CLASSPATH when you compile your program, or you did not install the JNDI classes properly as an extension, or you mistyped the class or package name.

Solution: The Java 2 SDK, v1.3 includes the JNDI classes. If you are using this version and get a class or package not found error, then double-check the spelling of the package and class.

If you are not using the Java 2 SDK, v1.3, then you need to download the JNDI classes and include them in your development environment. The way that you include the JNDI classes depends on your development environment.

If you are using the Java 2 SDK, v1.2, make sure that jndi.jar is in the JAVA_HOME/jre/lib/ext directory, where JAVA_HOME is the directory that contains the SDK. If you are using the javac compiler from the JDK 1.1, then add jndi.jar either to your CLASSPATH environment variable or to the -classpath option on your javac command line. See the Preparations (in the Tips for LDAP Users trail) lesson for more details.

Incompatible Java Platform Versions

Problem: You get compilation failures complaining about missing java.* packages or classes.

Cause: You are using an old version of the Java platform.

Solution: You need to use the Java 1.1.2 or higher. See

Previous | Next | Trail Map | Getting Started | Common Problems (and Their Solutions)