检查jar文件是否已加载? [英] Check if jar file is loaded?

查看:984
本文介绍了检查jar文件是否已加载?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在tomcat lib /文件夹中有一个自定义jar文件。据我所知,此文件夹中的任何jar文件都将在启动时加载。

I have a custom jar file in the tomcat lib/ folder. As per my knowledge, any jar file in this folder will be loaded on startup.

无论如何,我是否可以检查是否加载了特定的jar文件?

Is there anyway I can check if a particular jar file is loaded or not?

我在unix rhel5上运行tomcat-6.0.35.A。

I'm running tomcat-6.0.35.A on unix rhel5.

推荐答案

我想我已经在Tomcat日志文件中看到了哪些罐子在启动时打开了。如果没有,我可以考虑两种可能的替代方案:

I think I have seen which jars are open on startup in one of Tomcat log files. If not I could think about two possible alternatives:


  • 在Tomcat启动脚本中将 -verbose:class 添加到JAVA_OPTS 。它应该在JVM加载时打印类(大量输出)。 grep日志文件(或stdout)以查找是否列出了jar中的类

  • 使用Linux lsof 命令查看Tomcat进程打开的文件

  • Add -verbose:class to JAVA_OPTS in Tomcat startup script. It should print classes as they're loaded by JVM (lots of output). Grep log file (or stdout) to find if classes from your jar are listed
  • Use Linux lsof command fo see files opened by Tomcat process

这篇关于检查jar文件是否已加载?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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