Hi,

I've searched and tried the methods given before but things haven't been 
working for me.  My JAVA_HOME points to the 1.5 JDK.  I would like to 
compile my code to be able to run under JDK 1.4.  So, in my master POM, I 
have:

<build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <compilerVersion>1.4</compilerVersion>
          <source>1.4</source>
          <target>1.4</target>
        </configuration>
      </plugin>
    </plugins>
</build>

I've tried different permutations of the <compilerVersion>, <source>, and 
<target> tags being present and not, all to no avail.  The code compiles 
in all instances but when I execute the code, I get the exception:

java.lang.NoSuchMethodError: java.math.BigDecimal: method <init>(I)V not 
found

I googled this and I know it's because the 1.5 API has a new "int" 
constructor.  This means that my code is still being compiled with the 1.5 
JDK.  How can I get Maven to compile with the 1.4 JDK?  I've even tried 
setting the <executable> tag to point to the 1.4 javac.  The only way it 
works is if I point my JAVA_HOME to the 1.4 JDK, which I can't do because 
there are other applications that need to be compiled with 1.5 on the same 
machine.

Hope someone has done this successfully before.  Thanks.


_Mang Lau

Reply via email to