从JVM内部转储类路径上的类的方法? [英] Method to dump classes on the classpath from inside JVM?

查看:192
本文介绍了从JVM内部转储类路径上的类的方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的代码失败了 ClassNotFoundException

我可以看到包含该类的jar文件肯定在命令提示符执行的类路径中。

I can see that the jar file containing the class is definitely on the classpath from the command prompt execution.

有没有办法从JVM转储类路径上的类列表? (理想情况下是一些Java代码)。

Is there a way to dump the list of classes on the classpath from the JVM? (Ideally some Java code).

(我不想看到目录中的类,我想查看加载到JVM中的内容列表)。

(I don't want to see the classes in a directory, I want to see a list of what is loaded into the JVM).

推荐答案

如果您获得 CNFE ,因为没找到。此外,并非所有可用的课程都会在任何特定时间加载。

That's actually not what you want to see if you're getting a CNFE, since it's not found. Plus not all available classes will be loaded at any given time.

首先通过此列表。但一般情况下,如果找不到,实际上找不到它。

Start by going through this list. But in general, if it's not found, it's actually not found.

这篇关于从JVM内部转储类路径上的类的方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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