将外部JAR´S添加到JDK [英] Adding external JAR´S to JDK

查看:38
本文介绍了将外部JAR´S添加到JDK的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚开始使用Servlet和JSP开发在线应用程序.如您所知,我们需要一个doPost方法,该方法接收HttpServletRequest req,HttpServletResponse res)参数.

I just started developing online applications using Servlets and JSP. As you may know we need a doPost method which receives HttpServletRequest req,HttpServletResponse res) parameters.

我的问题如下.我了解我需要导入javax.servlet和javax.servlet.http.*包才能使其正常工作.我记得曾经有一位疯狂的老师告诉我,我可以修改jdk/jre/lib文件夹并添加那些我会用很多的外部jar,以免每次编译项目时都忘记更改类路径.那些人知道怎么做吗?我已经将servlet-api.jar复制到lib文件夹中,但是什么也没发生.

My question is the following. I understand I need to import the javax.servlet and javax.servlet.http.* package in order for this to work. I remember once a this crazy teacher who told me I could modify my jdk/jre/lib folder and add those external jar which I would use a lot in order to forget about changing the class path every time I compile a project. Those anyone know how to do this? I already copy the servlet-api.jar into the lib folder but nothing happens..

谢谢

推荐答案

对于外部JAR,请将其放在ext文件夹中. 例如.如果您使用的是64位JDK.

For external JARs put them in the ext folder. For example. If you are using 64bit JDK.

C:\ Program Files \ Java \ jdk1.8.0_25 \ jre \ lib \ ext

如果您使用的是32位版本的JDK,则路径可能如下所示.

If you are using 32bit version of JDK the path may look like this.

C:\ Program Files(x86)\ Java \ jdk1.8.0_31 \ jre \ lib \ ext

这篇关于将外部JAR´S添加到JDK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆