0

In my ini file for winrun4j java exe wrapper I set vm.version.min=1.7 to specify Java 7 as a requirement. But when I ran it I couldn't get winrun4j to recognise that I had a java 7 jre installed even though java -version from the command line returned it.

On further investigation I realized that my Java 7 installation was 64bit whereas my Java 6 installation was 32bit. I then found that winrun4j has some 64bit version of its commands (ie rcedit64), if I built an appname64.exe rather than appname.exe it no longer complained about Java 7.

  1. So can someone confirm this was the issue that I need a 64bit exe to run a 64bit jvm
  2. Secondly if this is the case how do I present this to the user, I'm wrapping the installer as an exe so does that mean I need to provide the user with both an installer.exe and a installer64.exe and explain to the user to pick the right one not based on their processor but based on what version of java they have installed32bit or 64bit)

Edit: Sounds like things are as i described, and using launch4j maybe a solution

What's the best way to start Java applications on Windows 7?

Community
  • 1
  • 1
Paul Taylor
  • 13,411
  • 42
  • 184
  • 351

1 Answers1

0

that I need a 64bit exe to run a 64bit jvm

Yes. You can not use a 32 bit exe to run the 64bit JVM

Secondly if this is the case how do I present this to the user, I'm wrapping the installer as an exe...

Don't. Just create an installer for a 32-bit system and a 64-bit system. Depending on the target system the corresponding installer should run

Cratylus
  • 52,998
  • 69
  • 209
  • 339
  • How does it run, the user has to double click on the installer – Paul Taylor Aug 14 '12 at 20:40
  • You can provide 2 installers. The user will pick the one for his system. When you installed the 64-bit Java in your PC, didn't **you** pick the 64-bit installer? – Cratylus Aug 14 '12 at 21:03
  • You are missing the point, you may have a 64bit system, but have 32bit Java installed, then using the 64bit installer wont work. Why would you install 32bit java on a 64 bit system, well it may have come preinstalled, it may have been installed by another application, you may have picked it thinking it was the safe option as 32bit java works on both 32bit and 64 bit systems. – Paul Taylor Aug 15 '12 at 00:13
  • I think you are overcomplicating things.I don't know what your application does, but normal users don't install different/various versions of java in their system. If you don't want for some reason to follow the most straightforward (IMHO) approach of delivering 2 installers, then you could try to deliver 1 installer which would carry the files for both 32x and 64x systems.Then depending on the target system do the correct installation – Cratylus Aug 15 '12 at 09:00
  • It really quite straightforward. Scenerio 1: the user already has Java32bit installed, they download my application they know they have a 64bit computer so run that installer and it complains it cant find Java. Scenareio 2: They already have Java 64bit installed, they come to download my program have no idea what 32bit/64bit is and hence insatll the 32bit version, once again it complains it cannot find Java. – Paul Taylor Aug 15 '12 at 09:30
  • Scenario 1.I really can not think of why a regular user with a 64-bit Java has installed a 32-bit Java (who downloads a 32-bit installer for a 64-bit machine I am not sure) but in this case if your installer can not find java you can instruct the user to download and install the 64-bit Java. Scenario 2:The user has installed the 64-bit Java but when the user downloads your program has no idea what a 32-bit/64-bit is and downloads the wrong version?Seriously now?Look here:http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1637583.html there is an installer for all target – Cratylus Aug 15 '12 at 10:14
  • You could also have a good description for such uneducated users – Cratylus Aug 15 '12 at 10:15
  • Hmm, whilst it true that jdk download page show separate 32bit and 64bit i dont think java.com does. and I dont think most Windows software asks the user to make that decsion at download time. – Paul Taylor Aug 22 '12 at 15:59
  • No because the user is **responsible** to know what kind of system he has, what kind of software he installs and what are the pre-requisites of a software he needs to install.Haven't you ever seen a README.txt with `setup.exe` installers? – Cratylus Aug 22 '12 at 16:31
  • What are you saying no to,what do you disagree with in my last message – Paul Taylor Aug 22 '12 at 19:13
  • `I dont think most Windows software asks the user to make that decsion at download time`. I think this is your concern.That due to this, you will have problem. – Cratylus Aug 22 '12 at 19:22
  • So you think most WIndows software provides two separate downloads, one for 64bit and one for 32bit ? – Paul Taylor Aug 22 '12 at 20:18
  • Windows software?If you build software using `.NET` then you have access to parts of the OS that you don't have with Java.So there could be top-notch installers that are specialized to detect your system and install the appropriate software.But can you mention 1 application you installed that you didn't have to select the installation type 32/64 bit as counterexample? – Cratylus Aug 22 '12 at 20:27
  • Example?Developers favorite tool!Wireshark:http://www.wireshark.org/download.html Choose your type – Cratylus Aug 22 '12 at 20:28
  • `Adobe Reader`.Somehow detects the OS but also provides options http://get.adobe.com/reader/otherversions/ – Cratylus Aug 22 '12 at 20:33
  • Ive never had to make this decision when downloading software from download.com and for a good user experience Im assuming users are totally dumb – Paul Taylor Aug 22 '12 at 21:41
  • I'm thinking about this from a different perspective now, who still has 32-bit PCs, I may just offer the 64bit version by default and possibly embed a jre to circumvent the problem altogether – Paul Taylor Aug 23 '12 at 17:03
  • Depends on your requirements and scope. But you know there are people that still use `Windows XP`...(Counting also those that passed on Vista and have not moved to `Windows 7`) – Cratylus Aug 23 '12 at 19:26
  • oh damn I was thinking its a hardware thing only, not a software thing – Paul Taylor Aug 23 '12 at 20:25
  • If you want to keep this simple (since already you went to the other extreme to give up 32 bit all together) then just offer 2 installers for the 2 systems. But it depends on your scope and requirements. – Cratylus Aug 23 '12 at 20:33
  • I eventually decided to release a 64bit and 32bit installer, the 64bit installer includes 64bit exe wrappers and 64bit JVM, the 32bit installer contains 32bit exe wrappers and 32bit JVM, On download page labelled 64 bit as (Windows 7 64 bit), and 32bit as Windows 7 32bit/Vista/XP – Paul Taylor Oct 03 '12 at 14:29