【问题标题】: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>
参考: