You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Stuart Sierra <th...@gmail.com> on 2009/09/29 20:49:58 UTC

Missing javac in maven-antrun-plugin task

Hi,

I have a Maven project that needs to call an Ant script (to build a
customized JRuby), which calls another Ant script (to compile JRuby
itself).

My POM contains:

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        <version>1.3</version>
        <executions>
          <execution>
            <id>ant-build-jruby</id>
            <phase>compile</phase>
            <configuration>
              <tasks>
                <ant/>
              </tasks>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>

But when I run it, I get the following error from Ant:

    Unable to find a javac compiler;
    com.sun.tools.javac.Main is not on the classpath.
    Perhaps JAVA_HOME does not point to the JDK.
    It is currently set to "/usr/lib/jvm/java-6-sun-1.6.0.06/jre"

My JAVA_HOME environment variable is set to "/usr/lib/jvm/java-6-sun",
which is a symlink to the JDK at "/usr/lib/jvm/java-6-sun-1.6.0.06".

Calling ant like an ordinary program using Codehaus' exec-maven-plugin
works fine.

Is Maven modifying the environment in which the ant task runs?  How
can I stop it?

Thanks,
-SS

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Missing javac in maven-antrun-plugin task

Posted by Stuart Sierra <th...@gmail.com>.
On Tue, Sep 29, 2009 at 3:39 PM, Stephen Connolly
<st...@gmail.com> wrote:
> set javac to fork

I could, but not without mofifying the original JRuby build.xml.
That's what I'm trying to avoid.

Running with the Maven exec plugin works for my purposes, though.

-SS

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Missing javac in maven-antrun-plugin task

Posted by Stephen Connolly <st...@gmail.com>.
set javac to fork

Sent from my [rhymes with tryPod] ;-)

On 29 Sep 2009, at 19:49, Stuart Sierra <th...@gmail.com>  
wrote:

> Hi,
>
> I have a Maven project that needs to call an Ant script (to build a
> customized JRuby), which calls another Ant script (to compile JRuby
> itself).
>
> My POM contains:
>
>      <plugin>
>        <groupId>org.apache.maven.plugins</groupId>
>        <artifactId>maven-antrun-plugin</artifactId>
>        <version>1.3</version>
>        <executions>
>          <execution>
>            <id>ant-build-jruby</id>
>            <phase>compile</phase>
>            <configuration>
>              <tasks>
>                <ant/>
>              </tasks>
>            </configuration>
>            <goals>
>              <goal>run</goal>
>            </goals>
>          </execution>
>
> But when I run it, I get the following error from Ant:
>
>    Unable to find a javac compiler;
>    com.sun.tools.javac.Main is not on the classpath.
>    Perhaps JAVA_HOME does not point to the JDK.
>    It is currently set to "/usr/lib/jvm/java-6-sun-1.6.0.06/jre"
>
> My JAVA_HOME environment variable is set to "/usr/lib/jvm/java-6-sun",
> which is a symlink to the JDK at "/usr/lib/jvm/java-6-sun-1.6.0.06".
>
> Calling ant like an ordinary program using Codehaus' exec-maven-plugin
> works fine.
>
> Is Maven modifying the environment in which the ant task runs?  How
> can I stop it?
>
> Thanks,
> -SS
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org