【问题标题】:Maven: Finding out whether running in a 32 or a 64 bit JVMMaven:确定是在 32 位还是 64 位 JVM 中运行
【发布时间】:2010-05-18 06:10:01
【问题描述】:

如何根据执行 maven 的 VM 是 32 位还是 64 位 JVM 来启用或禁用 maven 配置文件?

我试过了:

<activation>
   <os>
       <arch>x86</arch>
   </os>
 </activation>

amd64 分别检测 32/64 位 VM,但在 64 位 Windows 上运行的 32 位 VM 上会失败,因为它会激活 64 位配置文件。

【问题讨论】:

    标签: java maven-2 jvm maven


    【解决方案1】:

    在 Sun 虚拟机中, 检查系统属性sun.arch.data.model

    <profiles>
    <profile>
      <id>32bitstuff</id>
      <activation>
        <property>
          <name>sun.arch.data.model</name>
          <value>32</value>
        </property>
      </activation>
    </profile>
    
    <profile>
      <id>64bitstuff</id>
      <activation>
        <property>
          <name>sun.arch.data.model</name>
          <value>64</value>
        </property>
      </activation>
    </profile>
    
    </profiles>
    

    参考:

    【讨论】:

      猜你喜欢
      • 2012-03-17
      • 2014-08-04
      • 2011-04-04
      • 1970-01-01
      • 1970-01-01
      • 2011-04-19
      • 2013-09-16
      • 1970-01-01
      • 2010-12-28
      相关资源
      最近更新 更多