5

I have a SWT Java application that I am trying to have launched via Java Web Start. The 32 Bit version works fine, but many people can't get the 64 bit version to launch. They get an error saying can't run a 64 bit library on a 32 bit JVM. I've search Google and StackOverflow and others and can't find an answer about how to get Web Start to launch in a 64 bit JVM.

I have tried using JVM Options, (-d64, -J-d64) without any luck.

Is this even possible, or just I just limit to 32 bit version (ideally 64 bit is best as this app will parse lots of data from log files to display cleanly)? What do I need to change in my JNLP to allow this to work?

<?xml version = '1.0' encoding = 'windows-1252'?>
<jnlp spec="1.0+"
      codebase="http://example.com/confluence/download/attachments/212175616/"
      href="LogMiner_64Bit.jnlp">
     <information>
          <title>LogMiner 64 Bit</title>
          <vendor> TECH</vendor>
          <description>Parse Log messages </description>
          <shortcut online="true">
               <desktop/>
               <menu submenu="FA"/>
          </shortcut>
          <offline-allowed/>
     </information>
     <menu>64Bit</menu>
     <security>
          <all-permissions/>
     </security>
     <resources>
          <java version="1.7+" java-vm-args="-J-d64"/>
          <jar href="LogMiner64.jar" main="true" download="eager"/>
     </resources>
     <application-desc main-class="com.logMiner.ui.LogMiner"/>
</jnlp>

1 Answers1

4

You can make a single jnlp file supporting both architectures. For example:

<resources arch="amd64 x86_64">
  <jar href="LogMiner64.jar"/>
</resources>

<resources arch="x86 i386">
  <jar href="LogMiner32.jar"/>
</resources>

If necessary the resources tag can also take an os attribute, as in os="Linux", os="Mac" and os="Windows"

This way you can have a single jnlp file that will do the right thing with regards to native libs, no matter what OS and architecture the user is on.

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

Community
  • 1
  • 1
Dr.Haribo
  • 1,778
  • 1
  • 31
  • 43
  • 1
    Yes, but this doesn't help users who have both 32 & 64 Bit JVM on their machine make use of the extra memory that can be allocated. This is the main reason I'm trying to get the 64 bit to work. – user2857108 Dec 17 '16 at 02:07
  • 1
    JNLP will use the first matching resource. So, having the resources element with 64 bit arch first, will leave the second (32 bit) as a fall-back. You can, of course, remove the 32 bit arch resources element to disallow 32 bit JVM. – Hummeling Engineering BV Oct 19 '17 at 14:18