简体   繁体   English

使用两个版本的Eclipse进行Java编译

[英]Java compilation with two versions of Eclipse

I've got an old project in Eclipse 2.1 and compiled with a JDK 1.4.2_12. 我在Eclipse 2.1中有一个旧项目,并使用JDK 1.4.2_12进行了编译。 I want to upgrade the version of Eclipse to Eclipse Galileo. 我想将Eclipse的版本升级到Eclipse Galileo。

I've imported my project and set the compilation level to 1.4 and I've also updated my build path to use the correct JDK. 我已经导入了项目,并将编译级别设置为1.4,并且还更新了构建路径以使用正确的JDK。

The problem is that when I compare the compiled files in the classes folder in the two versions of Eclipse, the MD5 checksum are different. 问题是,当我比较两个版本的Eclipse中classes文件夹中的编译文件时,MD5校验和不同。

Should I be worried about that fact or this is normal? 我应该担心这个事实还是正常的?

This is normal. 这很正常。 The Eclipse compiler is free to change the class file structure as long as it conforms to the 1.4 JVM specification. Eclipse编译器可以自由更改类文件结构,只要它符合1.4 JVM规范即可。 If a 1.4 JVM will load and run the class, I see no issue. 如果1.4 JVM将加载并运行该类,则不会出现问题。

For truly pedantic cases, you should do your final builds with a JDK which matches the JRE, and not the Eclipse compiler. 对于真正的古怪案例,您应该使用与JRE匹配的JDK(而不是Eclipse编译器)进行最终构建。

As long as the program is working i dont think that you need to worry!!! 只要程序正常运行,我就认为您不必担心!!! As MD5 would be unique for each entity, and it represents the Hash value. 因为MD5对于每个实体来说都是唯一的,所以它代表哈希值。

It's normal, but I would make sure about doing a complete rebuild anyway (possibly erasing any existing class files). 这是正常的,但是无论如何我都会确保进行完整的重建(可能会擦除任何现有的类文件)。 My experience with Eclipse is that the incremental builder doesn't react well to unexpected situations. 我在Eclipse上的经验是,增量生成器不能很好地应对意外情况。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM