Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #35166
| From | parmenides <xparmenides@yahoo.com> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | How to direct javac to search a jar file? |
| Date | 2016-08-02 22:48 +0800 |
| Organization | Aioe.org NNTP Server |
| Message-ID | <nnqbs5$gs6$1@gioia.aioe.org> (permalink) |
Hi,
I'm learning how to write servlet. There is an example like this:
package home.parmenides;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class Hello extends HttpServlet{
public void init(ServletConfig config) throws ServletException{
super.init(config);
}
public void service(HttpServletRequest reqest,HttpServletResponse
response) throws IOException{
response.setContentType("text/html;charset=utf-8");
PrintWriter out=response.getWriter();
out.println("<html><body>");
out.println("<h2>Welcome to servlet。</h2>");
out.println("</body></html>");
}
}
Now that packages of servlet are imported. According to the tutorial,
these packages are archived in the C:\Tomcat 9.0\lib\servlet-api.jar,
and it is necessary to copy the file to a JDK directory, namely
C:\java\jre\lib. This works indeed. But, I think it is more convenience
to let javac to find the file rather than copying file. I added the
following path into the classpath:
C:\Tomcat 9.0\lib
But, javac can not find the servlet-api.jar. How can I deal with the
problem? Thanks.
Back to comp.lang.java.programmer | Previous | Next — Next in thread | Find similar | Unroll thread
How to direct javac to search a jar file? parmenides <xparmenides@yahoo.com> - 2016-08-02 22:48 +0800
Re: How to direct javac to search a jar file? Eric Douglas <e.d.programmer@gmail.com> - 2016-08-02 08:11 -0700
Re: How to direct javac to search a jar file? Nigel Wade <nmw@local.domain> - 2016-08-02 17:50 +0100
Re: How to direct javac to search a jar file? Eric Douglas <e.d.programmer@gmail.com> - 2016-08-02 10:49 -0700
Re: How to direct javac to search a jar file? Lew <lewbloch@gmail.com> - 2016-08-02 10:53 -0700
Re: How to direct javac to search a jar file? Eric Douglas <e.d.programmer@gmail.com> - 2016-08-02 11:11 -0700
Re: How to direct javac to search a jar file? Lew <lewbloch@gmail.com> - 2016-08-02 13:23 -0700
Re: How to direct javac to search a jar file? Eric Douglas <e.d.programmer@gmail.com> - 2016-08-03 05:32 -0700
Re: How to direct javac to search a jar file? Nigel Wade <nmw@local.domain> - 2016-08-03 14:30 +0100
Re: How to direct javac to search a jar file? Eric Douglas <e.d.programmer@gmail.com> - 2016-08-03 12:02 -0700
Re: How to direct javac to search a jar file? Arne Vajhøj <arne@vajhoej.dk> - 2016-08-03 19:34 -0400
Re: How to direct javac to search a jar file? Nigel Wade <nmw@local.domain> - 2016-08-04 14:22 +0100
Re: How to direct javac to search a jar file? Arne Vajhøj <arne@vajhoej.dk> - 2016-08-03 21:25 -0400
Re: How to direct javac to search a jar file? Lew <lewbloch@gmail.com> - 2016-08-05 15:31 -0700
csiph-web