• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem With JDK1.3 -- I Posted Before, But Could Not Get A Solution

 
Ranch Hand
Posts: 1309
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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)
 
Bartender
Posts: 783
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JiaPei,
This isn't a JDK problem with 1.2.2. vs 1.3. To compile Servlets, you need Tomcat. With 1.2.2, your classpath probably had the servlet.jar file set correctly. You're missing this jar file when you compile your program with JDK1.3. Go search for it somewhere on your HD, and add it to your classpath.
Read this article on writing Servlets. NOTE the second paragraph.
-Peter

[This message has been edited by Peter Tran (edited January 18, 2001).]
 
JiaPei Jen
Ranch Hand
Posts: 1309
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mr. Tran:
Would you kindly tell me the hyperlink of "this" in you reply? I clicked on "this" and could not get that page displayed. Thank you in advance.
JiaPei Jen
 
Peter Tran
Bartender
Posts: 783
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JiaPei,
I modified the hyperlink to the entire sentence.
-Peter
Ps. You can also click on the edit my posting to see the entire URL.
[This message has been edited by Peter Tran (edited January 18, 2001).]
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic