Error when running a 32 bit .dll on a 64 bit JVM Inteliij - intellij-idea

I am getting the below error when I try to execute the below line of code in my project. I added a 64 bit JDK to my project properties . I am using Intellij as my IDE
System.loadibrary(smsjavaagentapi)
Fatal Error: Exception from System.loadibrary(smsjavaagentapi) java.lang.unsatisfiedLinkError smsjavaagentapi.dll: Can't load IA 32 bit .dll on an AMD 64-bit platform
I think the problem is that I am using a 64 bit JVM and I am trying to run a 32 bit .dll. I don't have an option to install 32 bit JDK on my machine and add it to my project properties nor I can port the .dll to 64 bit . Is there a work around for this?

There is a limitation at the OS level which prevents a 32-bit shared library being loaded by a 64 bit process, so your options are
modify the OS to allow this (not easy)
migrate the DLL to 64-bit by recompiling it.
install a 32-bit JVM (easier)
download a 32-bit JVM and unpack it without install it. (doesn't require any special permission)
You might find you can get a version of IntelliJ which ships with a 32-bit JVM, or install another program which installs a 32-bit JVM and use just the JVM.

Related

Salesforce IDE starting error

I have installed the standalone IDE for salesforce force.com platform. On trying to start the ide i am getting "JVM terminated. Exit Code=-1" error. Any idea what this error code means ?
This is a common loading error for force.com IDE.
There are different solutions. Try anyone of these:
A) Change the workspace location.
OR
B) (i). Install Eclipse 3.6 for Java Developers (Helios) from the link http://www.eclipse.org/downloads/packages/eclipse-ide-java-developers/heliossr2
Click your operating system from the window on your right.
(ii). Using the below link, follow the instructions to install Force.com IDE plugin for Eclipse 3.6 http://wiki.developerforce.com/page/Force.com_IDE_Installation_for_Eclipse_3.6
OR
C) In the default Force.com IDE install directory:
C:\Program Files\salesforce.com\Force.com IDE
Locate the config file:
forceide
And comment out the following at the end of the file (note the leading #):
#-vmargs
#-Dfile.encoding=UTF-8
#-Xms256m
#-Xmx1024m
#-XX:PermSize=128M
#-XX:MaxPermSize=512M
I hope it works now.
Cheers!
This could be because of various reasons. Say, if you do not have enough memory (RAM) as specified in config file(forceide.ini). As said in this link Force.com IDE – JVM terminated , probably reduce MaxPermSize in config file to say 256M and check.
This exact thing happened to me a few days ago.
My setup is:
Windows 7 64 bit
jre7 64 bit
Force.com IDE 64 bit
When I ran the java auto update to update my jre it installed the 32 bit version (a whole other gripe). So I manually downloaded the 64 bit version of the jre installed it over the top of the 32 bit version and the IDE started working again.

how to determine whether installed library is 32 bit or 64 bit on windows?

How to determine whether library is 32 bit or 64 bit from the library file ? I have installed gstreamer from ossbuild for this I know its 32 bit but suppose if someone else installs a library what is the way to find if it is compatible with 32bit or 64bit . Also are the format of the library similar or they differ?
When you said "Library", I guess you mean "runtime Library" aka. Dynamic-Link Library (DLL), is that correct?
In that case, this might be a duplicate of this question

32 bit JDK on 64 bit Weblogic Server

Is it possible to run an application on a 64 bit Weblogic 10.3.2 Server instance with a 32 bit JDK?
The reason for me to doing this is getting an exceptions while running my program using 64 bit JDK.
UCFWin32JNI.dll: Can't load IA 32-bit .dll on a AMD 64-bit platform
The error is gone when using 32 bit JDK.
If it is possible, then how?
Thanks!
A 32-bit version of a library cannot be loaded and used by a 64-bit JVM, and vice versa.
Moreover, UCFWin32JNI.dll does not appear to be a WebLogic library at all. In fact, it appears to be a library from Documentum. You ought to be looking for a 64-bit version of that library (if it is available) as it appears to be a 32-bit version going by the name and the error message produced. Finally, you'll need to place the 64-bit version in one of the directories constituting java.library.path.
No problems at all running a 32bit JVM on a 64bit platform. In fact, for some applications it can actually be more efficient, due to the fact that certain data types are innately larger on a 64bit JVM (ints I think are an example of this from memory)
A 64bit JVM provides all sorts of advantages for an application requiring access to a larger heap, but there's no harm at all in running a 32bit JVM.

Building an NPAPI browser plugin on Linux x86 and x86_64, how do I ensure that it loads the correct version of its dependent libraries?

I'm attempting to build a Linux browser plugin using Firebreath that runs on 32bit and 64bit Linux.
In my X11/projectDef.cmake I have
target_link_libraries(${PROJECT_NAME}
${PLUGIN_INTERNAL_DEPS}
"${CMAKE_CURRENT_SOURCE_DIR}/lib/libOIS-1.4.0_32.so"
)
Currently I'm just manually changing that line switching 32 to 64 when I want to do a different build, so that's probably wrong. But my issue is that even when I build with the 32bit library and it compiles successfully, I get the following error when trying to load the plugin in Firefox:
$ firefox
LoadPlugin: failed to initialize shared library /home/daniel/.mozilla/plugins/npBoomstickJavaScriptJoystickSupport.so [libOIS-1.4.0.so: wrong ELF class: ELFCLASS64]
How do I set up my cmake to automatically include the correct library depending on the architecture? Is there a way to build both x86 and x86_64 simultaneously on the same machine? How do I get the plugin to load correctly or is there a way to further debug this problem?
As far as I know the only way to do a build for 32 bit on a 64 bit machine is to use cross compiling: http://www.vtk.org/Wiki/CMake_Cross_Compiling
I've never actually tried this, but inside CMake you can probably use the CMAKE_SIZEOF_VOID_P which will be 4 in 32 bit mode, 8 in 64 bit. You could add an if to your cmake script to set the correct binaries depending on the size of that.

Forcing 64 bit jvm to 32 bit jvm?

Would anyone please give me ideas about forcing 64 bit jvm to run as 32-bit jvm?
I need to write a jse desktop application for bluetooth connection. For that i need to implement Bluecove jar . It has 32-bit files only. So i included -D32 under VM arguments in eclipse pulsar. But still i am getting the same error that displayed before adding the argument: bluecove_x64.dll missing. I tried with -d32, and it showed me "unrecognized option: d32".
And it seems like i should install a 32-bit jvm that would run on 64-bit os. So, can anyone please tell me what exactly should i install? Java SDK in 32-bit or Eclipse software?
Thanks in advance!
Switching modes is only possible on Solaris. A JVM is either 64bit or 32bit, except on Solaris where both run modes are available in a single JVM.
But anyway, if you don't need more than 4Gig Ram, install the 32bit JVM also on 64bit Systems, because it is 10-15% faster and needs less memory.
First, install a 32-bit JVM. (I suppose this is under Windows).
Then in Eclipse, open the Preferences panel, and go to Java -> Installed JRE's.
Click Search, tell it to search your harddisk.
Wait.
You should now see both your original 64-bit JVM and your new 32-bit JVM in the list. Put the checkmark on the 32-bit JVM instead of the 64-bit JVM. Click OK.
You should now use a 32-bit JVM in Eclipse, which should be compatible with the library you have.