« October 2009
SunMonTueWedThuFriSat
    
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
22
23
24
25
26
27
28
29
30
31
       
Today
XML

Blog::Navigation

GetJava Download Button
Get the Source
Personal Blog

Blog::Referers

Today's Page Hits: 860

Powered by Roller Weblogger.
« ANTLRWorks and fun... | Main | What's new with... »
20070910 Monday September 10, 2007

javac's hidden options...

Sorry about not writing much these days. Hoping to blog again...

Earlier, I blogged about javac's hidden option "-printflat". I modified javac source to "open up" the hidden "-printflat" flag. Well, it turns out that you don't need to do that!! As per javac source docs, there are 4 kinds of options:

When I was reading javac source code, I stumbled upon "-XD" handling code in RecognizedOptions class in com.sun.tools.javac.main package. It appears that not much check is done by -XD handling code. With -XDxyz, the code puts "xyz", "xyz" as key-value pairs in compiler's options table. And with "-XDxyz=abc" the -XD handling code puts "xyz", "abc" as key-value pairs in options table. So, we can use

  javac -XD-printflat Main.java

to achieve what was done my previous blog entry. -XD-printflat would put "-printflat" in compiler's internal options table. No need to modify javac sources at all!



( Sep 10 2007, 12:49:48 PM IST ) Permalink del.icio.us | furl | simpy | slashdot | technorati | digg

Comments:

Post a Comment:

Comments are closed for this entry.
Copyright (C) 2005, A. Sundararajan's Weblog