My
Java programs with "import statment" get compiled without problem using JDK 1.2.2. However, when I use JDK 1.3, I have "cannot resolve symbol" error messages. I have personally tried three things:
1. download JDK1.3 again
2. compile the program by typing
javac -classpath c:\jdk1.3\jre\lib\rt.java ProgramName.java
3. set my autoexec.bat file
c:\jdk1.3;c:\jdk1.3\bin;
none of the three attemps worked. But the same java program compiled fine if I use JDK1.2.2 instead. I really need your wisdom.
To be specific:
This program (see below) (and my many other
Servlets programs) were compiled using JDK 1.2.2 without problem. When I use JDK 1.3 to compile this program, I got six error messages (error messages are listed after the program).
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class ThreeParams extends HttpServlet {
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html");
PrintWriter out = response.getWriter();
String title = "Reading Three Request Parameters";
out.println("" + "\n" +
"\n" +
"\n" +
"\n" +
"
" + title + "
\n" +
"
\n" +
"
param1: "
+ request.getParameter("param1") + "\n" +
"
param2: "
+ request.getParameter("param2") + "\n" +
"
param3: "
+ request.getParameter("param3") + "\n" +
"
\n" +
"");
}
}
error message:
The first two error messages point at
import javax.servlet.*;
import javax.servlet.http.*;
The other four error messages are:
ThreeParams.java:17: cannot resolve symbol
symbol: class HttpServlet
location: class ThreeParams
public class ThreeParams extends HttpServlet {
(an arrow point at the 'H' of HttpServlet)
ThreeParams.java:19: cannot resolve symbol
symbol: class HttpRequest
location: class ThreeParams
public void doGet( HttpServletRequest request,
(an arrow points at the 'H' of HttpServletRequest)
ThreeParams.java:20: cannot resolve symbol
symbol: class HttpServletResponse
location: class ThreeParams
HttpServletResponse response )
(an arrow points at the 'H' of HttpServletResponse)
ThreeParams.java:21: cannot resolve symbol
symbol: class ServletException
location: class ThreeParams
throws ServletException, IOException {
(an arrow points at the 'S' of ServletException)