Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java Web Start and 64 Bit JVM

Tags:

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>
like image 837
user2857108 Avatar asked Dec 15 '16 15:12

user2857108


1 Answers

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

like image 133
Dr.Haribo Avatar answered Nov 15 '22 06:11

Dr.Haribo