Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Lew Newsgroups: comp.lang.java.programmer Subject: Re: the classes in rt.jar cannot be found during ant build Date: Mon, 2 Apr 2012 15:53:32 -0700 (PDT) Organization: http://groups.google.com Lines: 27 Message-ID: <29434054.1356.1333407212535.JavaMail.geo-discussion-forums@pbcvg9> References: <21704562.1053.1333400837411.JavaMail.geo-discussion-forums@ynlt15> NNTP-Posting-Host: 69.28.149.29 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1333407213 28987 127.0.0.1 (2 Apr 2012 22:53:33 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 2 Apr 2012 22:53:33 +0000 (UTC) In-Reply-To: <21704562.1053.1333400837411.JavaMail.geo-discussion-forums@ynlt15> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=69.28.149.29; posting-account=CP-lKQoAAAAGtB5diOuGlDQk0jIwmH0T User-Agent: G2/1.0 Xref: csiph.com comp.lang.java.programmer:13323 zyng wrote: > In my build.xml, > > ... > > > > > ... > > The environment variable JAVA_HOME has been set to: C:\Program Files\Java\jdk1.6.0_24 > > When I run it, those classes inside rt.jar cannot be found. I have print out, using echo, the classpath and rt.jar is included in the classpath. > > I don't understand why the classes in rt.jar cannot be reached by javac. You don't give a complete example, for which you should follow the advice given here: http://sscce.org/ Did you use a "" element or "classpathrefid='...'" attribute to the "" element that refers to your path id? You should not include rt.jar in a regular classpath anyway. That's wrong. It's a bootclasspath JAR. In fact, you shouldn't have to refer to it explicitly at all unless you're cross-compiling between Java versions. Give us an SSCCE. -- Lew