Good day to you, Sha Jiang,

You may be running your maven2 in jdk1.5, but the plugins that uses java may
not necessarily use 1.5. 

For example, you can set the maven-compiler-plugin (which by default,
handles the compile phase of your build) to a different JVM ( see [1] ) or
by specifying the source and targets ( see [2] ). Furthermore, you can also
specify the JVM that you will use for the maven-surefire-plugin (which by
defaults, handles the test phase of your build) ( see [3] ).

Cheers,
Franz

[1]
http://maven.apache.org/plugins/maven-compiler-plugin/examples/compile-using-different-jdk.html
[2]
http://maven.apache.org/plugins/maven-compiler-plugin/examples/set-compiler-source-and-target.html
[3] http://maven.apache.org/plugins/maven-surefire-plugin/test-mojo.html#jvm


jiangshachina wrote:
> 
> Hi,
>> otherwise it defaults to 1.4 classes with the 1.5 JRE.
> I'm using JDK1.5.0_08, but Maven uses 1.3, but 1.4, as default.
> 
> a cup of Java, cheers!
> Sha Jiang
> 
> 
> Wayne Fay wrote:
>> 
>> Yes, to compile 1.5 classes, you must use a 1.5 (or greater) JRE. But
>> you also must set the 1.5 configuration, otherwise it defaults to 1.4
>> classes with the 1.5 JRE.
>> 
>> Wayne
>> 
>> On 11/11/06, jiangshachina <[EMAIL PROTECTED]> wrote:
>>>
>>> Hello,
>>> > <configuration>
>>> >     <source>1.5</source>
>>> >     <target>1.5</target>
>>> > </configuration>
>>> If that's true, I'm confused by the settings.
>>> Why Maven(or javac) can compile sources to 1.5-compatible classes at
>>> 1.4.2JRE(or 1.4.2 javac)?
>>> In order to fulfil the requirement, I think must install JDK1.5 firstly.
>>> Then use the real jre1.5.0 and configuration quoted above.
>>>
>>> a cup of Java, cheers!
>>> Sha Jiang
>>>
>>>
>>> Julio S. G. wrote:
>>> >
>>> >    Hi Allan,
>>> >
>>> >    Add these lines to you pom.xml:
>>> >
>>> > <project>
>>> >   <build>
>>> >     <plugins>
>>> >       <plugin>
>>> >         <artifactId>maven-compiler-plugin</artifactId>
>>> >         <configuration>
>>> >           <source>1.5</source>
>>> >           <target>1.5</target>
>>> >         </configuration>
>>> >       </plugin>
>>> >     </plugins>
>>> >   </build>
>>> > </project>
>>> >
>>> > Julio
>>> >
>>> >
>>> > On 11/10/06, Allan Valeriano <[EMAIL PROTECTED]> wrote:
>>> >> Hi all,
>>> >>
>>> >>
>>> >> I'm having problems setting up a new jre to run mvn install.
>>> >> My default java version is 1.4.2_11, but I need maven to use jre 5
>>> for
>>> >> it.
>>> >> I've read the FAQ, but I must say the example for it is not really
>>> >> helpful.
>>> >> Could somebody give me a hand on this sending a complete example?
>>> >>
>>> >>
>>> >> thanks in advance
>>> >> Allan Valeriano
>>> >>
>>> >>
>>> >
>>> > ---------------------------------------------------------------------
>>> > To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> > For additional commands, e-mail: [EMAIL PROTECTED]
>>> >
>>> >
>>> >
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Setting-up-a-new-jre-to-maven-tf2610500s177.html#a7299977
>>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Setting-up-a-new-jre-to-maven-tf2610500s177.html#a7330855
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to