I installed 64 Bit JVM first and then 32 Bit JVM. When I double-click a JAR, then it will use the 32 Bit JVM.
But when I start via the .exe, it uses the 64 Bit JVM.
How can I force launch4j to use the latest installed JVM or the 32 Bit JVM (no hardcoding of paths)?
My application ships with 32bit native libraries, so I'd be interested in an answer to this question too.
A third party jar loads a 32-bit DLL (JNI) and this fails if the user has a 64-bit JVM, even if he has a 32-bit one also, and even if a defines JAVA_HOME to point to the 32-bit JVM.
This would be really helpful for me also. Anyway to require a 64bit vm?
We also need a 32-bit-JVM to execute our various programs. We also currently can't support 64-bit-JVMs, since we have references to a large bunch of 32-bit-dlls.
More information about this topic:
This discussion links to a workaround (out of date):
But this workaround seems to be unsupported by current java versions:
I have tried the workaround (-D32) with launch4j-3.0.2-win32 and jre1.6.0_23, but it didn't work.
Are there any plans to extend launch4j by a 32BitOnly option (within the next weeks)?
Alternatively I could modify the source code in the head.c file. (The MIT license allows modifications.)
void regSearchWow(const char* keyName, const int searchType)
If I comment out the first if-block in this function (if (wow64 &&) and rebuild the object files I think my modified launch4j will start 32-bit JVMs in 64bit Windows and also in 32bit Windows.
A disadvantage of this approach is that we have to maintain our own launch4j version when we need to update for the next years.
I need to do the same thing. Did you modify launch4j?
I add my vote for this feature… sooner rather than later ;)
I have exactly the same problem : Into 64 bits environment if both 32 ans 64 bits JDK/JRE are installed this tools always detect the 64 bits version.
I have patched the source (java + C++) code to make my own version and re-compile all. I add a check box to FORCE the 32 bits JDK/JRE detection into 64 bits windows environment.
Just donwload the version and use it as the original one.
Version : http://ti1ca.com/txf1cgbu-launch4j-3.0.2-win32-Java32bitsDetection-launch4j-3.0.2-win32_Java32bitsDetection.zip.html
So do I
It would be a really useful when using JNI !
@feneck91 - thanks for the patched version - I'll give it a try in the coming days
This is almost what I want, but I still need some modifications (particularly : being able to select "only 32 bits JREs" or "only 64 bits JREs") … could you publish the modified sources so I can update them to fit my needs ? (it seems that the sources that are provided in your zip file are the original ones)
I have checked the source I give into this zip file. These files are modified one, not the original.
Check into the src directory (find Feneck91 tag on each modified line).
email me at Feneck91 on free.fr (not giving my email else robot will get it and I'll receive lot of spam).
This works for you or not ? Happy to see that it is used by others…