简体   繁体   English

我怎么知道已经编译了哪些类

[英]How do I know which classes have been compiled

I have a file A.java and a classpath to find other necessary classes. 我有一个文件A.java和一个类路径来查找其他必要的类。

So, I compile with 所以,我用

javac -cp myclasspath A.java

javac compiles A.java and whatever other files it needs from the classpath. javac编译A.java及其从类路径中需要的任何其他文件。

How can I know which exact files from the classpath have been compiled, besides A.java ? 除了A.java ,我怎么知道从classpath编译了哪些文件?

You can run javac with the -verbose option , and parse the results. 您可以使用-verbose选项运行javac,然后解析结果。

-verbose Verbose output. -verbose详细输出。 This includes information about each class loaded and each source file compiled. 这包括有关装入的每个类和编译的每个源文件的信息。

After you've cleaned your buildspace from class files, build and run a search command on your classpath, like 从类文件中清除构建空间后,请在类路径上构建并运行搜索命令,例如

Code : 代码:

find CLASSPATH -name "*\.class"

if you are on a unixolike os. 如果您使用的是unixolike操作系统。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何按已合并ID的2个列表的元素排序? - How do I sort elements of 2 lists by their id which have been merged? 如何检索已存储在firebase数据库中并显示在回收站视图中的图像? - How do I retrieve the images which have been stored in the firebase database and show in the recycler view? 考虑到我只有类的完全限定名称作为字符串,我怎么知道一个类是否是另一个类的超类? - How do I know if one class is superclass of another, given that I only have the fully qualified names of the classes as strings? 我如何知道是否已绘制视图 - How do I know if a view has been drawn 我如何知道 GRPC 连接是否已丢失? - How do I know if the GRPC connection has been lost? 如何垃圾收集已创建其内部类实例的对象? - How do I garbage collect objects which have created instances of their inner classes? 我如何知道交易是否失败并回滚? - How do I know if a transaction has failed and been rolled back? 如何知道哪些文件已被修改以修复从 git 提交开始的错误? - How to know which files have been modified to fix a bug starting from a git commit? 我如何知道编译了.class文件的Java版本? - How can I know with which Java version a .class file is got was compiled? 使用getItemViewType() - 我如何知道哪个布局为0,哪个布局为1? - Using getItemViewType() - How do I know which layout is 0 and which is 1?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM