开发者

Maven and wscompile

Hello I am trying to use wscompile ant task from Maven. I am able to call the ant task using the antrun Maven plugin. But wscompile started complaining:

[wscompile] error : com.sun.tools.javac.Main is not available in the classpath..

so I added the tools.jar as dependency as below

<dependency>
  <groupId>com.sun</groupId>
  <artifactId>tools</artifactId>
  <version>1.5.0_22</version>
  <scope>system开发者_运维技巧</scope>
  <systemPath>${java.home}/../lib/tools.jar</systemPath>
</dependency>

but no luck , so I Googled and got a solution as to add fork="true" to the wscompile task and it worked. Does any one know a better solution than this?


An alternative is to ensure you have a JAVA_HOME environment variable pointing to your JDK directory.

For example on Windows:

set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_26

or on Linux:

export JAVA_HOME="/usr/lib/jvm/java-6-sun-1.6.0.26"
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜