Of course if you don't fork it won't work.

On 3/30/06, Mang Jun Lau <[EMAIL PROTECTED]> wrote:
> I just tried using this method except with
> <compilerVersion>1.4</compilerVersion> and without <fork>true</fork> since
> javac fails if I use fork (probably due to
> http://jira.codehaus.org/browse/MCOMPILER-22).
>
> It doesn't work.  I'm still getting the "java.lang.NoSuchMethodError:
> java.math.BigDecimal: method <init>(I)V not found" exception, meaning
> maven is still using the 1.5 JDK to compile despite those settings.  Is
> forking absolutely necessary to use an older JDK?
>
> Using:
>
>         <configuration>
>           <source>1.4</source>
>           <target>1.4</target>
>           <compilerArguments>
>
> <bootclasspath>C:/j2sdk1.4.1/jre/lib/rt.jar;C:/j2sdk1.4.1/jre/lib/jce.jar</bootclasspath>
>           </compilerArguments>
>         </configuration>
>
> works well but seems like a hack.  Is this the proper way of using another
> JDK for compilation?
>
>
> _Mang Lau
>
>
>
>
>
> "Carlos Sanchez" <[EMAIL PROTECTED]>
> Sent by: [EMAIL PROTECTED]
> 03/28/2006 07:05 PM
> Please respond to
> "Maven Users List" <users@maven.apache.org>
>
>
> To
> "Maven Users List" <users@maven.apache.org>
> cc
>
> Subject
> Re: [M2] Compiling with JDK 1.4
>
>
>
>
>
>
> Check this out to actually use another JDK
>
>       <plugin>
>         <groupId>org.apache.maven.plugins</groupId>
>         <artifactId>maven-compiler-plugin</artifactId>
>         <configuration>
>           <fork>true</fork>
>           <compilerVersion>1.3</compilerVersion>
>           <executable>C:/Program
> Files/Java/jdk1.3.1_18/bin/javac</executable>
>           <!--
>           A portable way using environment variables
>           <executable>${JAVA_1_3_HOME}/bin/javac</executable>
>           -->
>         </configuration>
>       </plugin>
>
>
> On 3/28/06, Nicolas De Loof <[EMAIL PROTECTED]> wrote:
> >
> > This should work better :
> >
> >       <plugin>
> >         <groupId>org.apache.maven.plugins</groupId>
> >         <artifactId>maven-compiler-plugin</artifactId>
> >         <configuration>
> >               <compilerVersion>1.3</compilerVersion>
> >               <source>1.3</source>
> >               <target>1.3</target>
> >
> > <bootclasspath>${pom.getDependencyPath('jara:rt')}</bootclasspath>
> >         </configuration>
> >       </plugin>
> > ...
> >
> >     <dependency>
> >           <groupId>java</groupId>
> >           <artifactId>rt</artifactId>
> >           <version>1.3</version>
> >           <scope>system</scope>
> >     </dependency>
> >
> > Now, how to set the (computer specific) location of the "system" scoped
> > dependency ?
> >
> >
> http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html
>
> > only says the dependency will not be looked-up from repository, but HOW
> > to provide it ?
> >
> > Nico.
> >
> >
> > Nicolas De Loof a écrit :
> > >
> > > Could it be possible to set this "rt.jar" as a (system ?) dependency,
> > > something like this :
> > >
> > > <bootclasspath>${getDependencyPath("java:rt:1.3")}</bootclasspath>
> > >
> > >
> > > Siegmann Daniel, NY a écrit :
> > >> I too have had to override the JAVA_HOME JDK, though in my case it
> > >> was to
> > >> compile for 1.3 rather than 1.4. What you seem to be missing is
> > >> setting the
> > >> bootclasspath to the correct Java runtime library. Below is the
> > >> configuration I use. I hope this helps.
> > >>
> > >>       <plugin>
> > >>         <groupId>org.apache.maven.plugins</groupId>
> > >>         <artifactId>maven-compiler-plugin</artifactId>
> > >>         <configuration>
> > >>           <source>1.3</source>
> > >>           <target>1.3</target>
> > >>           <compilerArguments>
> > >>
> > >>
> <bootclasspath>..\..\tools\jdk\1.3.1_15\jre\lib\rt.jar</bootclasspath>
> > >>           </compilerArguments>
> > >>         </configuration>
> > >>       </plugin>
> > >>
> > >> --
> > >> Daniel Siegmann
> > >> FJA-US, Inc.
> > >> (212) 840-2618 ext. 139
> > >>
> > >>
> > >>> -----Original Message-----
> > >>> From: Mang Jun Lau [mailto:[EMAIL PROTECTED] Sent: Monday, March
> > >>> 27, 2006 5:28 PM
> > >>> To: users@maven.apache.org
> > >>> Subject: [M2] Compiling with JDK 1.4
> > >>>
> > >>>
> > >>> 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
> > >> <snip>
> > >>
> > >>> Hope someone has done this successfully before.  Thanks.
> > >>>
> > >>>
> > >>> _Mang Lau
> > >>>
> > >>>
> > >>
> > >> ---------------------------------------------------------------------
> > >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> > >> For additional commands, e-mail: [EMAIL PROTECTED]
> > >>
> > >>
> > >
> > > This message contains information that may be privileged or
> > > confidential and is the property of the Capgemini Group. It is
> > > intended only for the person to whom it is addressed. If you are not
> > > the intended recipient,  you are not authorized to read, print,
> > > retain, copy, disseminate,  distribute, or use this message or any
> > > part thereof. If you receive this  message in error, please notify the
> > > sender immediately and delete all  copies of this message.
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> >
> > This message contains information that may be privileged or confidential
> and is the property of the Capgemini Group. It is intended only for the
> person to whom it is addressed. If you are not the intended recipient, you
> are not authorized to read, print, retain, copy, disseminate,  distribute,
> or use this message or any part thereof. If you receive this  message in
> error, please notify the sender immediately and delete all  copies of this
> message.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> --
> I could give you my word as a Spaniard.
> No good. I've known too many Spaniards.
>                              -- The Princess Bride
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>


--
I could give you my word as a Spaniard.
No good. I've known too many Spaniards.
                             -- The Princess Bride

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

Reply via email to