<jreContainer>

Scope: Java Projects

Description

The jreContainer type allows you to define container classpathes that describe an installed JRE. Due to the fact that Ant4Eclipse can't know about jre's installed in Eclipse you can declare them using this type.

Using this type requires to specify the pathes of the used JRE's with their configured names within Eclipse. You can find these names within the preferences ("Window->Preferences...", then "Java->Installed JREs").

The mapping between the JRE's and their IDs will follow this specific scheme: each entry will be mapped to 'org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/ name of the JRE'. This way the JRE container entries can be resolved and used by the other Ant4Eclipse tasks.

There is one exception to this rule. This is the default JRE_CONTAINER. If you dont' have specified an explizit JRE on your classpath, you'll have the org.eclipse.jdt.launching.JRE_CONTAINER on your classpath instead. If you don't tell ant4eclipse which JRE to use for this kind of JRE, ant4eclipse would use the JRE you're running Ant with. To specify a alternate JRE, you can use the default attribute on jreContainer that points to the id of a JRE you have specified as nested element.

Arguments

Argument Description Required
default The id of a jre that should be used as the default JRE no

Nested Elements

A JRE must be defined using the nested jre element that allows the following arguments:

Argument Description Required
id The name of the JRE as specified within the Eclipse preferences. yes
location The filesystem location of the corresponding JRE root directory. yes

Examples

Let's say you're generally using the following VM's in your Eclipse environment (the VM's are configured within Eclipse under Preferences->Java->Installed JREs):

Now you have JRE 1.4 as the default one but some projects do require 1.3 or 1.6, so they're having special entries within the .classpath files. This can be configured using the following setup:

That would make the JDKs JDK_1_3 and JDK_1_6 available for projects that have the corresponding org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/XXX entry in their .classpath file and JDK_1_4 available for projects that have the org.eclipse.jdt.launching.JRE_CONTAINER on their classpath.