Question: I am trying to use [SVMLight](http://svmlight.joachims.org/) from Java, using the [JNI wrapper on this page](http://www.mpi-inf.mpg.de/~mtb/):

```
  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.

Answer: 
Yes, you'll have to recompile the DLL for 64-bit. Your only other option is to switch to a 32-bit JVM, or otherwise get some 32-bit process to load the DLL on your behalf and communicate with that process somehow.
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-bit `JVM` for the program with the 32-bit `DLL`.

For the compilation, it shouldn't matter which `javac` gets used - 32-bit or 64-bit. 

```
>javac MyProgramWith32BitNativeLib.java

```

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:

```
>"C:\Program Files (x86)\Java\jre#.#.#_###\bin\java.exe" MyProgramWith32BitNativeLib 

```

The difference will be in the numbers after `jre`. To find which numbers you should use, enter:

```
>dir "C:\Program Files (x86)\Java\"

```

On my machine, the process is as follows

```
C:\Users\me\MyProject>dir "C:\Program Files (x86)\Java"
 Volume in drive C is Windows
 Volume Serial Number is 0000-9999

 Directory of C:\Program Files (x86)\Java

11/03/2016  09:07 PM    <DIR>          .
11/03/2016  09:07 PM    <DIR>          ..
11/03/2016  09:07 PM    <DIR>          jre1.8.0_111
               0 File(s)              0 bytes
               3 Dir(s)  107,641,901,056 bytes free

C:\Users\me\MyProject>

```

So I know that my numbers are `1.8.0_111`, and my command is

```
C:\Users\me\MyProject>"C:\Program Files (x86)\Java\jre1.8.0_111\bin\java.exe" MyProgramWith32BitNativeLib

```