假设我在 Eclipse 中编写 Java 代码,然后将其保存为可运行的 .jar 文件。代码是 100% 自己编写的,因此没有从其他来源导入。
.jar 文件(文件头,..)中是否包含有关我的 PC 或 Eclipse 版本的私有(private)数据?
最佳答案
是的,可能有一个自动生成的 list 文件 (jar:META-INF/MANIFEST.MF)
这是插件的默认输出
Manifest-Version: 1.0
Built-By: borisov andrey
Build-Jdk: 1.7.0_05
Created-By: Apache Maven
Archiver-Version: Plexus Archiver
如您所见, list 文件中至少添加了用户名
更新:如果您正在使用 maven,您可能需要配置 maven jar 插件
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>${maven-jar-plugin-version}</version>
<inherited>true</inherited>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
<configuration>
<archive>
<manifestEntries>
<Created-By>${java.version} (${java.vendor})</Created-By>
<Built-By>ME</Built-By>
<Implementation-Title>${project.name}</Implementation-Title>
<Implementation-URL>SOME URL if you want</Implementation-URL>
<Implementation-Version>${project.version}</Implementation-Version>
<Implementation-Vendor>your company</Implementation-Vendor>
<Implementation-Vendor-Id>your vendore id</Implementation-Vendor-Id>
</manifestEntries>
</archive>
</configuration>
</plugin>
关于java - 可运行的 jar (通过 Eclipse)是否包含跟踪信息?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11669081/