Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: zyng Newsgroups: comp.lang.java.programmer Subject: Re: the problem for accessing the classes in rt.jar Date: Wed, 18 Apr 2012 08:35:05 -0700 (PDT) Organization: http://groups.google.com Lines: 24 Message-ID: <21528069.1815.1334763305959.JavaMail.geo-discussion-forums@yntt13> References: <22583724.345.1334591253848.JavaMail.geo-discussion-forums@vbvf19> <4f8e0210$0$290$14726298@news.sunsite.dk> <14699406.1250.1334754816127.JavaMail.geo-discussion-forums@vbyj26> <29910219.1583.1334761581496.JavaMail.geo-discussion-forums@ynjm4> NNTP-Posting-Host: 205.156.36.56 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1334763306 1032 127.0.0.1 (18 Apr 2012 15:35:06 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 18 Apr 2012 15:35:06 +0000 (UTC) Cc: avl@logic.at In-Reply-To: <29910219.1583.1334761581496.JavaMail.geo-discussion-forums@ynjm4> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=205.156.36.56; posting-account=oo44OQoAAABMDvaRlaO3SeQ5MVbxqLdH User-Agent: G2/1.0 X-Received-Bytes: 2462 Xref: csiph.com comp.lang.java.programmer:13638 My goodness. The problem is solved. By searching Google, I found this link which provides the explanation and the answer: http://stackoverflow.com/questions/4065401/using-internal-sun-classes-with-javac I copied his answer here: "When javac is compiling code it doesn't link against rt.jar by default. Instead it uses special symbol file lib/ct.sym with class stubs. Surprisingly this file contains many but not all of internal sun classes. In my case one of those more-internal-than-usual classes was sun.awt.event.IgnorePaintEvent. And the answer to my question is: javac -XDignore.symbol.file That's what javac uses for compiling rt.jar." So, in my build.xml, the target "compile", I have: In project.classpath, I don't need to explicitly reference rt.jar at all! Now it compiles fine.