I have compiled my java application with JDK 64-bit on windows, then i packaged the JAR file using Excelsior Jet 11.3 (64-bit) to give me an elegant exe executable ready to use by end users running windows.
The exe file works just fine on my machine (Windows 7 64-bit) but when i deployed to other 32-bit systems (windows xp & windows 7), it does not work, it shows the error message saying that the exe is not recognized as a valid 32-bit program.
How can i solve this?
Well, the standard ways of distributing Java (JAR files, WebStart, etc) avoid this because bytecodes are platform independent. You have deliberately chosen to distribute EXE files, which are inherently platform specific.
If you want to stick with EXEs can think of two alternatives:
Build and distribute a different EXE for each of the OS + hardware platform combinations that you need to support. (32 Windows, 64 bit Windows, various MacOS, Linux on Intel, Linux on ARM, Solaris, etc)
Pick a lowest common denominator; e.g. a 32 bit Windows EXE should be runnable on a 64 bit Windows OS.
But I would recommend either getting the user to install a JRE, or providing an installer that installed an embedded JRE.