There are different dimensions to this. Maven uses JAVA_HOME when executing.
But it is also possible to define, for instance, that the compilation of
your classes should use a different JDK. You do this by configuring the
maven-compiler-plugin like this:
http://maven.apache.org/plugins/maven-compiler-plugin/examples/compile-using-different-jdk.html

You say you want to use Java 1.4 with Maven. Why/what for? Newer versions of
Maven (2.2.0+) requires Java 1.5. But there shouldn't be any problems using
a 1.4 JDK for the actual compilation, for example. You can also force a 1.5
JDK to produce 1.4 compiled code:
http://maven.apache.org/plugins/maven-compiler-plugin/examples/set-compiler-source-and-target.html

Does this help?

/Anders

2010/1/9 Piotr Kozak <[email protected]>

> Hello
>
> How to force maven to use concrete java.
> I have 3 java's (1.4, 1.5, 1.6).
> I would like to use 1.4 with maven and have JAVA_HOME set to 1.6. Is it
> possible?
> Even if I set JAVA_HOME to 1.4, I think maven uses java from
> c:\windows\system32 which is the newest 1.6 jre :(
>
> Thanks in advance.
> Peter
>
> ----------------------------------------------------------------------
> Czujesz sie swietnie? Czy wprost przeciwnie?
> Moze to Twoj biorytm? Sprawdz >> http://link.interia.pl/f2533
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to