在运行JDK 1.8的javac后,目录中剩下的文件。

huangapple go评论72阅读模式
英文:

Files left in directory after running javac for JDK1.8

问题

如果我运行

javac File.java

并运行ls,剩下的是

129161 File.class File.java
file 129161
129161: data
ls -l
32768 Jul 24 20:41 129161
 1493 Jul 24 20:53 File.class
 1018 Jul 23 16:08 File.java

这些文件明显是二进制文件,但前几行包含以下内容:

@J8sun.rt._sync_EmptyNotifications8J0sun.rt._sync_NotificationsJ8sun.rt._sync_ContendedLockAttempts8J0sun.rt._sync_FutileWakeups0J(sun.rt._sync_Parks
                                                               8J0sun.rt._sync_SlowEnter8J0sun.rt._sync_SlowExit8J0sun.rt._sync_SlowNotify8J0sun.rt._sync_SlowNotifyAll8J0sun.rt._sync_FailedS

是否有人能够解释或引用文档,说明为什么每次我运行javac时都会在这个目录中创建奇怪的数字文件。

记录一下,我只在使用Oracle JDK 1.8的版本中看到这种情况。

英文:

If I run

javac File.java

and run ls, what's left is

129161 File.class File.java
file 129161
129161: data
ls -l
32768 Jul 24 20:41 129161
 1493 Jul 24 20:53 File.class
 1018 Jul 23 16:08 File.java

The files obviously a binary, but the first couple of lines include:

@J8sun.rt._sync_EmptyNotifications8J0sun.rt._sync_NotificationsJ8sun.rt._sync_ContendedLockAttempts8J0sun.rt._sync_FutileWakeups0J(sun.rt._sync_Parks
                                                               8J0sun.rt._sync_SlowEnter8J0sun.rt._sync_SlowExit8J0sun.rt._sync_SlowNotify8J0sun.rt._sync_SlowNotifyAll8J0sun.rt._sync_FailedS

Can anyone explain or reference documentation of exactly why the strangely number files are created in this directory every time I run javac.

For the record, I only see this with versions of oracle JDK 1.8.

答案1

得分: 1

我在中文网站的版本上找到了这个,正如它所说,您可能已经将这些文件放置在开发系统的通常临时目录中。

在“可读”行中寻找一些符号,似乎指向了hsperfdata构件。请参阅这个hsperfdata Github解析项目。在退出后,可以安全地将它们删除。Java

注意:如果这些是hsperfdata组件,数字是进程标识符。您可能已将这些文件放置在开发系统的通常临时目录中。

(最初的假设是其余文件可能是从已删除的JAR文件中提取出的类文件构件。)

英文:

I found this on the chineese version of the web site as it says,You may have placed these files in the usual temporary directories of the development system.

The search for a few symbols in the "readable" line seems to point to the hsperfdata artifact. See this hsperfdata Github parsing project. After exiting, it is possible to safely delete them. Java

Note: If these are hsperfdata components, the numbers are process identifiers. You may have placed these files in the usual temporary directories of the development system.

(The initial assumption is that the remaining files may be class file artifacts extracted from deleted JAR files.)

答案2

得分: 0

当您将一个Java文件编译为:javac File.java(回车),然后会生成一个.class文件,这是Java字节码,它是Java虚拟机(JVM)用来解释您的代码的指令集。

英文:

When you compile a java file as: javac File.java(enter) then .class file is generated which is java byte code, which is the instruction set of the Java virtual machine (JVM) to interpret your code.

huangapple
  • 本文由 发表于 2020年7月25日 05:06:55
  • 转载请务必保留本文链接:https://go.coder-hub.com/63081466.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定