将外部jar放在JAVA_HOME / lib / ext目录中是件坏事吗? [英] Is putting external jars in the JAVA_HOME/lib/ext directory a bad thing?

查看:507
本文介绍了将外部jar放在JAVA_HOME / lib / ext目录中是件坏事吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个在JRE环境中运行的应用程序。该应用程序使用一些外部jar,我们已将它们放在JAVA_HOME / lib / ext文件夹中。这对我们来说已经有好几年了,但最近一位新的程序员加入了我们的团队,并且似乎强调这是一件多么糟糕的事情。在我进一步深入了解这个开发人员之前,我无法理解为什么并且我正在尝试做一些研究。这里有什么我想念的吗?

We have an application which runs in a JRE environment. The application uses some external jars and we have been putting them in the JAVA_HOME/lib/ext folder. This has worked for us for years but recently a new programmer joined our team and seems emphatic that this is some how a bad thing to do. I can't understand why and I'm trying to do some research before I dig further with this developer. Is there something I'm missing here?

推荐答案

是的 - 这是件坏事。想一想:应用程序依赖于JRE和一些额外的罐子。如果您更新JRE怎么办?然后你必须记住将文件复制到新的JRE中。如果您需要在新系统上设置应用程序,该怎么办?您必须在那里复制应用程序,然后还记得将外部jar复制到该系统上的JRE中。

Yes - it's a bad thing. Think about it: the application depends on the JRE and some extra jars. What if you update the JRE? Then you have to remember to copy the files into the new JRE. What if you need to set up the application on a new system? You have to copy the application there, and then also remember to copy the external jars into the JRE on that system.

这两个问题根本不是问题如果您只是将应用程序与所需的外部jar一起正确打包。如果你没有看到这个,那么也许这根本不是问题。但你仍然应该感谢新人分享他的意见。

Both those issues wouldn't be an issue at all if you just package the application properly together with the external jars it needs. If you don't see this, then maybe it's not an issue at all. But you should still be grateful for the new guy for sharing his opinion.

这篇关于将外部jar放在JAVA_HOME / lib / ext目录中是件坏事吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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