location of -source / -target in new build infrastructure

Joe Darcy joe.darcy at oracle.com
Fri Apr 20 19:02:40 UTC 2012

Actually the long-standing recommended practice is to explicitly set 
source, target, and encoding when compiling:


This means you get the language semantics you're asking for :-)  This is 
appropriate when building the JDK too.


On 4/20/2012 11:52 AM, Mike Duigou wrote:
> The filed that needed modifying turned out to be
> jdk/makefiles/common/shared/Defs-java.gmk
> It explicitly sets source and target versions. As you suggest this shouldn't be necessary. I can see why specifying source/target is necessary for code compiled with the bootstrap javac but in other cases we should be avoiding explicit specification and let the compiler use it's default. I was also kind of dubious about the specification of -encoding ascii I was pretty sure we had joined the 21st century and all the java source files are using utf-8.
> Mike
> On Apr 20 2012, at 10:48 , Fredrik Öhrström wrote:
>> Yes, a leftover exist in Setup.gmk thanks for spotting that David!
>> the -source 7 -target 7 should be replaced with $(BOOT_JDK_SOURCETARGET)
>> which is setup by configure and stored in the spec.gmk file.
>> That flag is only be used for compiling code that has to be
>> run by the boot jdk. The particular setup that uses -source 7 -target 7
>> in Setup.gmk is called GENERATE_OLDBYTECODE, which seems correct.
>> However for all new bytecode, the remaining setups seems to lack both
>> -source and -target, which is the intent, since I assumed that it would automatically
>> build for jdk8 then?
>> //Fredrik
>> ----- david.holmes at oracle.com skrev:
>>> Hi Mike,
>>> Check out: jdk/makefiles/Setup.gmk
>>> David
>>> On 20/04/2012 10:13 AM, Mike Duigou wrote:
>>>> Hello All;
>>>> I am working on merging the new build infra into the lambda
>>> workspace and have run into a minor problem. The javac compile for the
>>> jdk sources is run with -source 7 -target 7 rather than -source 8
>>> -target 8. In the classic build system for the lambda repo everything
>>> except langtools is compiled with source/target 8. I looked and
>>> couldn't find where the new build sets the source version. Any helpful
>>> pointers?
>>>> Thanks,
>>>> Mike

More information about the build-dev mailing list