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


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

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

From zyng <xsli2@yahoo.com>
Newsgroups comp.lang.java.programmer
Subject Re: the problem for accessing the classes in rt.jar
Date 2012-04-18 08:35 -0700
Organization http://groups.google.com
Message-ID <21528069.1815.1334763305959.JavaMail.geo-discussion-forums@yntt13> (permalink)
References <22583724.345.1334591253848.JavaMail.geo-discussion-forums@vbvf19> <4f8e0210$0$290$14726298@news.sunsite.dk> <14699406.1250.1334754816127.JavaMail.geo-discussion-forums@vbyj26> <slrnjothhs.kvi.avl@gamma.logic.tuwien.ac.at> <29910219.1583.1334761581496.JavaMail.geo-discussion-forums@ynjm4>

Show all headers | View raw


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:
	<target name="compile" depends="prepare">
		<javac srcdir="${src.dir}" destdir="${build.dir}" compiler="modern" fork="yes" debug="on">
			<classpath refid="project.classpath"/>
			<compilerarg value="-Xlint"/>
			<compilerarg value="-verbose"/>
			<compilerarg value="-XDignore.symbol.file"/>
		</javac>
	</target>

In project.classpath, I don't need to explicitly reference rt.jar at all! Now it compiles fine.

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