Skip to main content



      Home
Home » Newcomers » Newcomers » Eclipse uses libs outdide of build path
Eclipse uses libs outdide of build path [message #268988] Wed, 04 March 2009 11:01 Go to next message
Eclipse UserFriend
Dear all,
I have a Java project in my eclipse 3.3.2. In my build path libraries, I
have only two libs:

- wre.jar : this is the JRE I want to use. It does not contain the XML APIs
- xml-apis.jar : the XML APIs from apache xml-commons

In particular I have _no_ system JRE (eg. from Sun) in the build path.

If I run the following code:

import org.w3c.dom.Text;
public class TextTest {
public static void main(String[] args) {
System.out.println(Text.class.getResource("Text.class"));
}
}

it prints out
jar:file:/C:/Program%20Files/Java/jdk1.6.0_02/jre/lib/rt.jar !/org/w3c/dom/Text.class

Why does it not get the org.w3c.dom.Text from the xml-apis.jar which is
in the build path, but rather from the default JRE which is installed on
the system?

What settings should I change, so that the classes aree taken from the
jars in the build path?

Thanks for your answers.
Phil
Re: Eclipse uses libs outdide of build path [message #268992 is a reply to message #268988] Wed, 04 March 2009 11:42 Go to previous message
Eclipse UserFriend
"Philipp" <kitschen@romandie.com> wrote in message
news:gom8lo$pt7$1@build.eclipse.org...
> Dear all,
> I have a Java project in my eclipse 3.3.2. In my build path libraries, I
> have only two libs:
>
> - wre.jar : this is the JRE I want to use. It does not contain the XML
> APIs
> - xml-apis.jar : the XML APIs from apache xml-commons
>
> In particular I have _no_ system JRE (eg. from Sun) in the build path.
>
> If I run the following code:
>
> import org.w3c.dom.Text;
> public class TextTest {
> public static void main(String[] args) {
> System.out.println(Text.class.getResource("Text.class"));
> }
> }
>
> it prints out
> jar:file:/C:/Program%20Files/Java/jdk1.6.0_02/jre/lib/rt.jar !/org/w3c/dom/Text.class
>
> Why does it not get the org.w3c.dom.Text from the xml-apis.jar which is in
> the build path, but rather from the default JRE which is installed on the
> system?
>
> What settings should I change, so that the classes aree taken from the
> jars in the build path?


What you're noticing is that the runtime path is different than the build
path.

You can control the runtime path in the launch configuration settings. For
instance, go to the project properties and click on Run/Debug settings; edit
your launch configuration; and go to the "JRE" tab and/or the "Classpath"
tab.

The default is to use whatever JRE is the default JRE in the Eclipse
preferences.
Previous Topic:Eclipse
Next Topic:Files disappear from navigator and project views
Goto Forum:
  


Current Time: Sat May 03 10:56:06 EDT 2025

Powered by FUDForum. Page generated in 0.08343 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top