Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
438 views
in Technique[技术] by (71.8m points)

32bit 64bit - How to distinguish 32 bit from 64 bit java version in jnlp files

To start our legacy application, we use java WebStart via a jnlp.

We would like to support 64-bit Java clients but one of our libraries is architecture dependent.

We thought of doing something like:

<resources>
  <j2se version="1.6+" sun.arch.data.model="64"/>
  <jar href="/apps/swt-3.7M5-win32-win32-x86_64_s.jar" download="eager" />
</resources>
<resources>
  <j2se version="1.6+" />
  <jar href="/apps/swt-3.7M5-win32-win32-x86_s.jar" download="eager" />
</resources>

This is not working because the parameter sun.arch.data.model="64" is used to set the parameter instead of testing on it.

Any ideas?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

This is explained in the documentation, here: http://docs.oracle.com/javase/7/docs/technotes/guides/javaws/developersguide/syntax.html#resources

It doesn't say which arch values make sense, though. You would want it to work for different JVM implementations and versions. I googled around for a while and here's what I've ended up using:

  <resources>
    <java version="1.6+"/>
    <jar href="lwjgl-2.8.4.jar"/>
    <jar href="lwjgl_util-2.8.4.jar"/>
  </resources>

  <!-- LWJGL Linux 64-bit native libraries -->
  <resources os="Linux" arch="amd64">
    <nativelib href="lwjgl-amd64-linux.jar"/>
  </resources>
  <resources os="Linux" arch="x86_64">
    <nativelib href="lwjgl-amd64-linux.jar"/>
  </resources>

  <!-- LWJGL Linux 32-bit native libraries -->
  <resources os="Linux" arch="x86">
    <nativelib href="lwjgl-x86-linux.jar"/>
  </resources>
  <resources os="Linux" arch="i386">
    <nativelib href="lwjgl-x86-linux.jar"/>
  </resources>

  <!-- LWJGL Windows 64-bit native libraries -->
  <resources os="Windows" arch="amd64">
    <nativelib href="lwjgl-amd64-win.jar"/>
  </resources>
  <resources os="Windows" arch="x86_64">
    <nativelib href="lwjgl-amd64-win.jar"/>
  </resources>

  <!-- LWJGL Windows 32-bit native libraries -->
  <resources os="Windows" arch="x86">
    <nativelib href="lwjgl-x86-win.jar"/>
  </resources>
  <resources os="Windows" arch="i386">
    <nativelib href="lwjgl-x86-win.jar"/>
  </resources>

  <!-- LWJGL MAC OS/X native libraries -->
  <resources os="Mac">
    <nativelib href="lwjgl-macosx.jar"/>
  </resources>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...