Javac: package not found error

java

I'm trying to compile a java file which imports other packages I created; however, it doesn't seem to find them.

In my compile.bat file I have:

set classpath=c:\t\DB;c:\t\Frame 
javac comchange.java 

where the beginning section of commChange.java has

package commchange;

import java.sql.*;
import java.awt.event.*;
import java.applet.*;
import DB.*;
import java.awt.*;
import java.util.*;
import javax.swing.*;
import java.awt.Graphics;
import Frame.*;

and the directory structure is:

c:\t\commChange.java
c:\t\DB
c:\t\Frame

The error I'm getting is:

commChange.java:12: package DB does not exist 
import DB.*; 

commChange.java:17: package Frame does not exist 
import Frame.*;

commChange.java:23: cannot find symbol 
symbol: class Frame 
... 

Any ideas?

Best Solution

classpath is the list of directory roots where classes, identified by package.ClassName, are loaded from. You need to set the following classpath:

set classpath=c:\t
Related Question