On 09/11/2012 10:46 PM, Fredrik Öhrström wrote:
However, this begets the question why -Xprefer:source was added in the first place. If I remember correctly, this was over a year ago. It turns out that the default behavior for implicit compilation (which is necessary for sjavac:s multi core support) is to not recompile java source files when the class has a more recent timestamp than the source file. Sounds reasonable, until you realize that javac also takes into account the timestamps in rt.jar inside the jdk. Soooo, if you check out the source code on Monday, then download a newly built jdk on tuesday, and use this as the boot jdk, then the rt. jar timestamps will be newer than the source files you are trying to compile, and this somehow messes up the build!
When you are compiling JDK, you should not be reading or in any way dependent of the bootdir rt.jar (except insofar as it is needed to execute javac itself.) The compilation itself should not read bootdir rt.jar. Indeed, you should be able to set -Xbootclasspath to build/PLATFORM-ARCH/classes, which will initially be empty.
-- Jon