aspose file tools*
The moose likes Beginning Java and the fly likes Importing packages - frustrated?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Importing packages - frustrated??" Watch "Importing packages - frustrated??" New topic
Author

Importing packages - frustrated??

Narayana Swamy
Greenhorn

Joined: Jul 03, 2000
Posts: 6
Hi,
I am sort of frustrated with the import statement usage for user-defined classes in java. I have gone through the messages on this topics posted on this subject but I am still not clear. I want this thing to work seamlessly as it works for import java.io.* or java.net.*
I have created a directory called c:\test
Then created another two directories c:\test\client and c:\test\request
My classpath statement looks like this:
SET CLASSPATH = ./;c:\test;c:\jdk1.2.2\bin
My path statement looks like this:
SET PATH = c:\test;c:\jdk1.2.2\bin
I have a file called Logon.java in c:\test\request which looks like this:
package request;
import java.io.*;
public class Logon {
.....
....
...
}
I have a file called DataClient.java in c:\test\client which looks like this:
package client;
import java.io.*;
import request.*;
public class DataClient {
Logon a;
a = new Logon();
....
....
}
I successfully compiled and created the Logon.class file. Now, when I try to compile the DataClient file, I get an error saying that 'package request not found in import'. How do I correct this error? I don't want to do any quick and dirty fix-ups like copying the class files from one directory to the other or including the Logon.java file in the javac command while compiling DataClient. DataClient must be able to compile by just saying 'javac DataClient.java' in the c:\test\client directory. Can anybody please help me?
Thanks in advance.

swamy
Narayana Swamy
Greenhorn

Joined: Jul 03, 2000
Posts: 6
Sorry about my rant in the previous message. I actually got the thing working finally. I was making the stupid mistake of not running the autoexec.bat after every time I made a change to it. Just making a change and saving the autoexec.bat doesn't do a thing unless it is executed.
K.N. Swamy
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Importing packages - frustrated??