I am trying to use SVMLight from Java, using the JNI wrapper on this page:
static {
System.loadLibrary("lib/JNI_SVM-light-6.01/lib/svmlight");
}
I get the following error:
... lib\JNI_SVM-light-6.01\lib\svmlight.dll: Can't load IA 32-bit .dll on a AMD 64-bit platform
Can I solve this by recompiling the .dll for 64 bit? How would I go about doing this? Is there some other workaround I can use? SVMLight makes the C source code available.
I had a problem when run red5(tomcat) on Windows x64 that previous worked under Windows x32, got next error:
Problem solved when I installed Java x32 version and set next
"Environment variables"
"User variables for Home"
JAVA_HOME => C:\Program Files (x86)\Java\jdk.1.6.0_45
"System variables"
Path[at the beginning] => C:\Program Files\Java\jdk.1.8.0_60;..
Short answer to first question: yes.
Longer answer: maybe; it depends on whether the build process for SVMLight behaves itself on 64-bit windows.
Final note: that call to System.loadLibrary is silly. Either call System.load with a full pathname or let it search java.library.path.
Here is an answer for those who compile from the command line/Command Prompt. It doesn't require changing your
Path
environment variable; it simply lets you use the 32-bitJVM
for the program with the 32-bitDLL
.For the compilation, it shouldn't matter which
javac
gets used - 32-bit or 64-bit.For the actual execution of the program, it is important to specify the path to the 32-bit version of
java.exe
I'll post a code example for
Windows
, since that seems to be the OS used by the OP.Windows
Most likely, the code will be something like:
The difference will be in the numbers after
jre
. To find which numbers you should use, enter:On my machine, the process is as follows
So I know that my numbers are
1.8.0_111
, and my command isGo to
Project properties >> Run >> VM options
and put this address:
Got this from - http://blog.cedarsoft.com/2010/11/setting-java-library-path-programmatically/
If set the java.library.path, need to have the following lines in order to work.
Just go to install download jdk_x86 and it install in Program Files (x86) and set the jre path in your project. Thats it.