maven---com.sun:tools:jar:1.5.0

关于Maven构建Appfues时出com.sun:tools:jar:1.5.0错的解决方法

在使用Maven构建Appfues时通常都会出现

Java代码 复制代码
  1. Missing:   
  2. ----------   
  3. 1com.sun:tools:jar:1.5.0  
  4.   
  5.   Try downloading the file manually from the project website.  
Missing:
----------
1) com.sun:tools:jar:1.5.0

  Try downloading the file manually from the project website.

 
出现以上原因是因为jdk没有配好。我们只需要修改一个pom.xml就ok了
<!--jdk-->
  <dependency>  
          <groupId>com.sun</groupId>  
          <artifactId>tools</artifactId>  
          <version>1.6.0</version>  
          <scope>system</scope>  
          <systemPath>C:/Program Files/Java/jdk1.6.0_05/lib/tools.jar</systemPath>  
   </dependency>

 

注意<systemPath>${java.home}/../lib/tools.jar</systemPath>我们通常是使用系统的环境变量取得java.home的路径的

 

评论
2 楼 limeng1028 2009-01-12   引用
我在我的构建的pom中没有看到
  <dependency>  
          <groupId>com.sun</groupId>  
          <artifactId>tools</artifactId>  
          <version>1.6.0</version>  
          <scope>system</scope>  
          <systemPath>C:/Program Files/Java/jdk1.6.0_05/lib/tools.jar</systemPath>  
   </dependency>
1 gordianyuan 2008-09-24   引用
http://maven.apache.org/general.html#tools-jar-dependency

How do I include tools.jar in my dependencies?

The following code includes tools.jar for JDKs on Windows, Linux and Solaris (it is already included in the runtime for Mac OS X and some free JDKs).

...
  <profiles>
    <profile>
      <id>default-tools.jar</id>
      <activation>
        <property>
          <name>java.vendor</name>
          <value>Sun Microsystems Inc.</value>
       </property>
     </activation>
      <dependencies>
        <dependency>
          <groupId>com.sun</groupId>
          <artifactId>tools</artifactId>
          <version>1.4.2</version>
          <scope>system</scope>
          <systemPath>${java.home}/../lib/tools.jar</systemPath>
       </dependency>
     </dependencies>
   </profile>
</profiles>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值