seem to be facing a classic issue with a maven-antrun-plugin task being run with the jre rather than the jdk and not finding the compiler. Haven't yet found the proper fix though. Any ideas?
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.7:run (rdt-remote-jars) on project org.eclipse.ptp.rdt.core.remotejars: An Ant BuildException has occured: The following error occurred while executing this line: [[ERROR] /export/home/orion/fedora/eclipse-ptp/eclipse-ptp-6.0.2/org.eclipse.ptp-PTP_6_0_2/rdt/org.eclipse.ptp.rdt.core.remotejars/build.xml:152: Unable to find a javac compiler; [ERROR] com.sun.tools.javac.Main is not on the classpath.
seem to be facing a classic issue with a maven-antrun-plugin task being run with the jre rather than the jdk and not finding the compiler. Haven't yet found the proper fix though. Any ideas?
Java compiler is in tools.jar, you need to add it to classpath of antrun plugin explicitly, for example:
<plugins> <plugin> <artifactId>maven-antrun-plugin</artifactId> [...] <dependencies> <dependency> <groupId>com.sun</groupId> <artifactId>tools</artifactId> <version>1.7</version> <scope>system</scope> <systemPath>${java.home}/../lib/tools.jar</systemPath> </dependency> </dependencies> </plugin> </plugins>
Mikolaj
On 12/04/2012 01:07 AM, Mikolaj Izdebski wrote:
seem to be facing a classic issue with a maven-antrun-plugin task being runwith the jre rather than the jdk and not finding the compiler. Haven't yet found the proper fix though. Any ideas?
Java compiler is in tools.jar, you need to add it to classpath of antrun plugin explicitly, for example:
<plugins> <plugin> <artifactId>maven-antrun-plugin</artifactId> [...] <dependencies> <dependency> <groupId>com.sun</groupId> <artifactId>tools</artifactId> <version>1.7</version> <scope>system</scope> <systemPath>${java.home}/../lib/tools.jar</systemPath> </dependency> </dependencies> </plugin> </plugins>
Mikolaj
That's already there, although perhaps not in the right place? See attached pom.xml. Or maybe because the version is too old?
Quoting Orion Poplawski (2012-12-04 16:38:00)
On 12/04/2012 01:07 AM, Mikolaj Izdebski wrote:
seem to be facing a classic issue with a maven-antrun-plugin task being runwith the jre rather than the jdk and not finding the compiler. Haven't yet found the proper fix though. Any ideas?
Java compiler is in tools.jar, you need to add it to classpath of antrun plugin explicitly, for example:
<plugins> <plugin> <artifactId>maven-antrun-plugin</artifactId> [...] <dependencies> <dependency> <groupId>com.sun</groupId> <artifactId>tools</artifactId> <version>1.7</version> <scope>system</scope> <systemPath>${java.home}/../lib/tools.jar</systemPath> </dependency> </dependencies> </plugin> </plugins>
Mikolaj
That's already there, although perhaps not in the right place? See attached pom.xml. Or maybe because the version is too old?
That mapping is in a profile which only gets activated with Sun JDK. This is wrong. Moving the dependency into proper build/plugins section should solve the issue. I am not entirely sure why upstream decided to put it into profile. Maybe something to do with macs? Maybe some fix could be upstreamed too...
On 12/05/2012 05:34 AM, Stanislav Ochotnicky wrote:
Quoting Orion Poplawski (2012-12-04 16:38:00)
On 12/04/2012 01:07 AM, Mikolaj Izdebski wrote:
seem to be facing a classic issue with a maven-antrun-plugin task being runwith the jre rather than the jdk and not finding the compiler. Haven't yet found the proper fix though. Any ideas?
Java compiler is in tools.jar, you need to add it to classpath of antrun plugin explicitly, for example:
<plugins> <plugin> <artifactId>maven-antrun-plugin</artifactId> [...] <dependencies> <dependency> <groupId>com.sun</groupId> <artifactId>tools</artifactId> <version>1.7</version> <scope>system</scope> <systemPath>${java.home}/../lib/tools.jar</systemPath> </dependency> </dependencies> </plugin> </plugins>
Mikolaj
That's already there, although perhaps not in the right place? See attached pom.xml. Or maybe because the version is too old?
That mapping is in a profile which only gets activated with Sun JDK. This is wrong. Moving the dependency into proper build/plugins section should solve the issue. I am not entirely sure why upstream decided to put it into profile. Maybe something to do with macs? Maybe some fix could be upstreamed too...
Thanks, I've moved it down into the build/plugins section and it works there. I've pinged upstream about it.
java-devel@lists.fedoraproject.org