Thanks to those of you who responded.
 
I fixed the problem.
 
I *thought* that is all the class files where in the same directory as the java files, import (without a package name would work).
 
This turned out to be false for my Windows 2000 environment, V1.3 of JSDK.  Whether I used ANT or whether I set up CLASSPATH and used javac, it simply would not compile without the package qualifier.
 
I fixed the problem by adding the following lines to my ANT build.xml file:
 <fileset dir="${catalina.home}/common/classes">
      <include name="CCMsg.class"/>
    </fileset>
 
Oh, well, since it works, I am going to use this mechanism.
 
Happy Sunday!
 
Frank
----- Original Message -----
Sent: Sunday, April 07, 2002 1:54 PM
Subject: Import Problem

I am having trouble compiling my servlet under Windows.  It works when I compile the same code under Linux, but Windows gives me an error.
 
Here are my import statements:
 
 

import java.io.*;

import java.text.*;

import java.util.*;

import javax.servlet.*;

import javax.servlet.http.*;

import org.xml.sax.SAXException;

import org.xml.sax.InputSource;

import CCMsg;
 
The last statement gives me an error:
[javac] c:\simple\src\CCServlet.java:8: '.' expected
[javac] import CCMsg;
[javac]                      ^                    
It *seems* like javac is asking me to create a "package" but I want all of my classes to be in root so I do not want to create a package.
 
Thanks for any hints!
 
Frank

Reply via email to