Forcing 32 bit Java as a Prerequisite - Advanced Installer Community
wbinns
Posts: 6
Joined: Fri Jul 19, 2013 12:05 am

Forcing 32 bit Java as a Prerequisite

I have created an application that runs on Windows 32 or 64 bit environments but requires a 32 bit Java JVM to run. When I install the application on a machine that has a 64 bit version of Java I get the following error:

java.lang.UnsatisfiedLinkError: Cannot load 32-bit SWT libraries on 64-bit JVM

Is there anyway to force the loading of a 32 bit version of Java if only a 64 bit version is present?
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Forcing 32 bit Java as a Prerequisite

Hi and welcome to Advanced Installer forums.

When you go in the Java Products page and add a new product, you can also choose the platform for this product. If it is set to "32-bit" then it shouldn't even try to run on a 64-bit JVM.

However, you can select "Settings" in the "Products" pane and use the [Add JRE Bundle] button to add a 32-bit JVM or you can go in the Prerequisites page and add it as a prerequisite.

Let us know if this helped, otherwise give us more details about your scenario.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
wbinns
Posts: 6
Joined: Fri Jul 19, 2013 12:05 am

Re: Forcing 32 bit Java as a Prerequisite

What happened is that the Java updater installed a new version of 64 bit Java on my test computer and when it removed old versions it removed my 32 bit Java.

I removed the application from the test machine and was testing a new install. Java is set up as a prerequisite in the installation package. When I went to install the installer didn't prompt to install a 32 bit version of Java.

I am using the SWT Toolkit (the same framework used to build Eclipse) and it has native libraries that require a specific architecture (32 bit library for 32 bit Java). I want to use 32 bit since that will maximize compatibility and not require separate 32 bit and 64 bit versions.

I am looking at including Java in the install package to eliminate issues with Java version issues on the customers' PC's. Which would be the best approach?

Set Java as a Prerequisite and selecting Use files from disk to force installation of the correct Java version.

Select Bundled JRE from the Java tab.

Let me know your recommendations and pro's and con's of each approach.

Thanks,

Will
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Forcing 32 bit Java as a Prerequisite

Hi Will,
When I went to install the installer didn't prompt to install a 32 bit version of Java.
I'm not sure why you encounter this behavior. Can you please send us the .AIP (project file) to support at advancedinstaller dot com so we can investigate it?

Also, can you please tell us which 64-bit Java version is installed on your test machine, which 32-bit Java version do you try to install as a prerequisite and which Operating System is installed on your test machine so we can try to reproduce the behavior?

If you add Java 32-bit as a JRE Bundle it will be uninstalled when your application will be uninstalled, while as a prerequisite it will not be uninstalled.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”