Adding javac flag -XDallowInterceptTypes for javadoc

Erik Joelsson erik.joelsson at oracle.com
Fri Dec 7 01:31:25 PST 2012


There seems to be some confusion regarding the old and new build. The 
old build is what's still default and official. It is started by running 
make in the root dir of the forest and does not involve configure. The 
new build uses configure, so you need to run configure first and then 
(if in the root dir) type make NEWBUILD=true. The new build does not 
build docs unless asked for it so I suspect you are only building with 
the old.

Your strategy for adding the flag in the old build seems valid to me. 
Why docs are failing because of it, I really don't know. Your new 
parameter is not added to the javadoc commandline from what I can see. 
Perhaps javadoc is failing because of the new feature being active in 
some of the newly compiled classes? Is the problem that you need to add 
the new flag to the javadoc command line too? Then JAVADOCSFLAGS is set 
in jdk/make/common/shared/Defs-java.gmk.

The simplest way to add a flag to javac temporarily in the new build is 
to set JAVAC_FLAGS in the environment to configure. I'm not sure this is 
how we intend it to work in the future, but it's working now. Example:

JAVAC_FLAGS=-XDallowIntersectionTypes bash configure
make NEWBUILD=true

If you want to make it permanent and a bit more limited in scope, look 
in jdk/makefiles/Setup.gmk where the javac configuration for building 
the jdk repo is initialized.

/Erik

On 2012-12-06 19:23, Henry Jen wrote:
> On Dec 6, 2012, at 1:48 AM, Erik Joelsson<erik.joelsson at oracle.com>  wrote:
>
>> I'm not sure what you are trying to do and have no idea what -XDallowIntersectionTypes means, but changing any makefiles in jdk/make will not affect the new build.
> This is to temporarily enable a currently-disabled(but will be enabled in JDK8) compiler feature.
>
>> The new build makefiles is found in jdk/makefiles. Most of the java classes are built in one single javac invocation, so adding the flag to only specific files is tricky.
>>
> Hmm, perhaps I missed some step. I believe I did 'rm -fr build' for each attempt to make build. Perhaps I forgot to clean up some environment variable.
>
> Anyway, I am looking for a way to add that flag for now so we don't have to be blocked on integrating the feature. Ideally in a limited scope just to minimize the impact. If not possible, what's the suggested way to change it?
>
> BTW, I tried OTHER_JAVACFLAGS with configure, same error for javadoc. So I assume there is a separate flag to be set for javadoc's purpose?
>
> Cheers,
> Henry
>
>
>> /Erik
>>
>> On 2012-12-06 06:26, Henry Jen wrote:
>>> Hi,
>>>
>>> I am trying to build TL repo which support intercept type cast, in order
>>> to make the build, I added
>>>
>>> OTHER_JAVACFLAGS += -XDallowIntersectionTypes
>>>
>>> to make/java/jave/Makefiles, which works for new build, but failed for
>>> old build in javadoc step.
>>>
>>> Would you please advise what would be the right approach to fix this for
>>> javadoc?
>>>
>>> Cheers,
>>> Henry
>>>
>>>
>>> /java/re/jdk/1.7.0/archive/fcs/binaries/linux-amd64/bin/java
>>> -XX:-PrintVMOptions -XX:+UnlockDiagnosticVMOptions -XX:-LogVMOutput
>>> -Xmx1024m -Xms512m -XX:PermSize=32m -XX:MaxPermSize=160m
>>> "-Xbootclasspath/p:/home/hjen/ws/tl/build/linux-amd64/langtools/dist/bootstrap/lib/javadoc.jar:/home/hjen/ws/tl/build/linux-amd64/langtools/dist/bootstrap/lib/javac.jar:/home/hjen/ws/tl/build/linux-amd64/langtools/dist/bootstrap/lib/doclets.jar"
>>> -jar
>>> /home/hjen/ws/tl/build/linux-amd64/langtools/dist/bootstrap/lib/javadoc.jar
>>> -bootclasspath "/home/hjen/ws/tl/build/linux-amd64/classes"  -d
>>> /home/hjen/ws/tl/build/linux-amd64/docs/api \
>>> 	  @/home/hjen/ws/tl/build/linux-amd64/tmp/docs/doctmp/coredocs.options
>>> @/home/hjen/ws/tl/build/linux-amd64/tmp/docs/doctmp/coredocs.packages
>>> ../../src/share/classes/java/util/Comparators.java:114: error:
>>> intersection types in cast are not supported in -source 1.8
>>>          return (Comparator<Map.Entry<K, V>>   &   Serializable)
>>>                                              ^
>>>    (use -source 8 or higher to enable default methods)
>>> 1 error



More information about the build-infra-dev mailing list