Can I run a java program developed using 32-bit jdk with 64-bit jre? application uses 32-bit non-java-system libraries

I am developing a Java application using 64-bit eclipse for a 64-bit installation of Windows 7. I am forced to use the 32-bit JDK (1.7.0) because the application uses Jpcap , which will not compile with the 64-bit JDK.

The application should be a cross platform for 32-bit and 64-bit systems, which usually happens with Java applications developed using any JDK. But I think the situation is a bit complicated, because, in addition to banks, Jpcap installs system libraries (.dll / .so), which, in turn, are shells for WinPcap and libpcap. Thus, a Jpcap call is a sequence of nested calls to these libraries.

Here's the question:

Will the application executable work on 64-bit platforms? assuming that users will have the necessary x86 libraries installed (jpcap.dll / .so, WinPcap, libpcap), since 64-bit versions do not exist for Windows libraries.

+6
source share
2 answers

Will the application executable work on 64-bit platforms? assuming that users will have the necessary x86 libraries installed (jpcap.dll / .so, WinPcap, libpcap), since 64-bit versions do not exist for Windows libraries.

You need a 32-bit JRE to run the application. 64-bit Jots Hotspot cannot use 32-bit native libraries.

But the flip side is that it doesn't matter if you use 64-bit or 32-bit Eclipse to develop and build ... provided that you configure Eclipse to run the 32-bit JRE for any testing that involves themselves native libraries.

And to be clear, you can run the 32-bit JRE on a 64-bit OS platform, but not vice versa.


UPDATE - it is obvious that jpcap.dll can be created for 64-bit Windows - see this post: https://groups.google.com/forum/?fromgroups=#!topic/jpcap/-vxZv0eAcp4

+5
source

From memory (and it's a bit foggy), I would not do that.

Native libraries (at least under windows) must run within the same bit-by-bit as the JVM.

So, so that you can load your x32-bit libraries, you have to work in an x32-bit process (or x32-bit JVM)

+1
source

All Articles