Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #13593

Re: the problem for accessing the classes in rt.jar

From Lew <lewbloch@gmail.com>
Newsgroups comp.lang.java.programmer
Subject Re: the problem for accessing the classes in rt.jar
Date 2012-04-16 14:31 -0700
Organization http://groups.google.com
Message-ID <16778553.2086.1334611902913.JavaMail.geo-discussion-forums@pbtr10> (permalink)
References <22583724.345.1334591253848.JavaMail.geo-discussion-forums@vbvf19> <jmhkg2$k3o$1@dont-email.me>

Show all headers | View raw


On Monday, April 16, 2012 10:22:09 AM UTC-7, markspace wrote:
> On 4/16/2012 8:47 AM, zyng wrote:
> > 			<compilerarg value="-verbose"/>
> 
> This is smart and a good idea.  It shows that the classes are being 
> loaded, yes?
> 
> 
> > The printout shows that indeed all those JAR files inside jre/lib are loaded:
> 
> Good!
> 
> 
> > However, I need this to compile successfully:
> >                  <include name="jre/lib/rt.jar"/>
> 
> This is crazy and there's no need to do this.

Furthermore, rt.jar belongs in the *bootclasspath*, not the classpath, as was stated before. You never need to refer to it explicitly. Your problem lies elsewhere, OP.

> > (/A/B/java is a solft link to /A/B/jdk1.6.0_25)
> 
> This could be an issue.  Please remove all links, hard and soft, and use 
> only one single canonical path.   If /A/B on your system is /usr/lib, 
> use only that.  If /A/B is C:\Program Files\Java, use only that.
> 
> The Java runtime loads files according to their path names, and may 
> become confused if it sees the same file twice with a different path 
> name.  I haven't had problems with it myself, but if we're hunting 
> obscure bugs let's eliminate all possible sources of error.
> 
> 
> > To make my story short, my findings is that in order to compile, rt.jar must shows up twice and the path must be different from the first time by these observations:
> > 1) this won't compile:
> > 	
> 
> >             <fileset dir="/A/B/jdk1.6.0_25/">
> >                  <include name="jre/lib/rt.jar"/>
> >             </fileset>
> >             ...
> > 	</path>
> 
> This make  no sense.  Why won't it compile?  What error message do you 
> get?  It's just a path, it shouldn't "compile" on its own unless you 
> have a javac tag or similar.
> 
> 
> >                  <include name="jre/lib/rt2.jar"/>
> 
> This is a horrendously bad idea and can only make matters worse.  I 
> think at this point you've messed things up so bad we can't really help 
> you.  Remove ALL extra files from the Java installation directory that 
> you created, or delete the whole thing and reinstall it to be safe.
> 
> 
> > (java loads rt2.jar, now my code compiles successfully)
> ...
>  > 3)this will work(copy jre/lib to somewhere else beforehand)
> 
> Something is really badly messed up here.
> 
> 
> > Can you help me understand this?
> 
> 
> Can you delete your entire Java installation and re-install it?
> Then please make a very simple "Hello World" program, plus its ant build 
> file, and post EVERYTHING you are doing here, as well as all error 
> messages and program output.  Here's a simple example for ant:
> 
> <http://ant.apache.org/manual/tutorial-HelloWorldWithAnt.html>

Follow markspace's advice. You're doing completely the wrong thing trying to use rt.jar explicitly. Don't do that.

-- 
Lew

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

the problem for accessing the classes in rt.jar zyng <xsli2@yahoo.com> - 2012-04-16 08:47 -0700
  Re: the problem for accessing the classes in rt.jar markspace <-@.> - 2012-04-16 10:22 -0700
    Re: the problem for accessing the classes in rt.jar Lew <lewbloch@gmail.com> - 2012-04-16 14:31 -0700
  Re: the problem for accessing the classes in rt.jar Arne Vajhøj <arne@vajhoej.dk> - 2012-04-17 19:51 -0400
    Re: the problem for accessing the classes in rt.jar zyng <xsli2@yahoo.com> - 2012-04-18 06:13 -0700
      Re: the problem for accessing the classes in rt.jar Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2012-04-18 13:48 +0000
        Re: the problem for accessing the classes in rt.jar zyng <xsli2@yahoo.com> - 2012-04-18 08:06 -0700
          Re: the problem for accessing the classes in rt.jar zyng <xsli2@yahoo.com> - 2012-04-18 08:35 -0700
            Re: the problem for accessing the classes in rt.jar Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2012-04-18 16:02 +0000
            Re: the problem for accessing the classes in rt.jar markspace <-@.> - 2012-04-18 09:02 -0700
              Re: the problem for accessing the classes in rt.jar zyng <xsli2@yahoo.com> - 2012-04-18 10:49 -0700
                Re: the problem for accessing the classes in rt.jar Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2012-04-18 18:49 +0000
          Re: the problem for accessing the classes in rt.jar Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2012-04-18 15:50 +0000
          Re: the problem for accessing the classes in rt.jar Arne Vajhøj <arne@vajhoej.dk> - 2012-04-18 21:07 -0400
      Re: the problem for accessing the classes in rt.jar markspace <-@.> - 2012-04-18 07:45 -0700

csiph-web