I am trying to load a DLL using System.load()
in Java. I get this exception:
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Documents and Settings\dvargo\Local Settings\Temp\jmacm.dll: Can't load this .dll (machine code=0x0) on a IA 32-bit platform at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1803) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1699) at java.lang.Runtime.load0(Runtime.java:770) at java.lang.System.load(System.java:1003) at GlobalUtilities.DllManager.dynamicallyLoadDLL(DllManager.java:160) at GlobalUtilities.DllManager.dynamicallyLoadDLLs(DllManager.java:182) at JMFManager.JMFRunner.dynamicallyLoadJMFDllsFromResource(JMFRunner.java:152) at JMFManager.JMFRunner.main(JMFRunner.java:164)
What does it mean?
EDIT:
I have some dlls in my jar file. I get them out of the jar file and write them to the temp folder with the following code:
private static ArrayList buf;
public static InputStream soundStreams;
public static File getResourceFile(String resourceName, File dest)
{
InputStream is = null;
BufferedReader br = null;
int line;
ArrayList list = new ArrayList();
try
{
is = new Object().getClass().getResourceAsStream(resourceName);
br = new BufferedReader(new InputStreamReader(is));
while (-1 != (line = br.read()))
{
list.add(line);
}
}
catch (Exception e)
{
e.printStackTrace();
}
finally
{
try
{
if (br != null)
{
br.close();
}
if (is != null)
{
is.close();
}
File newFile = dest;
newFile.createNewFile();
FileOutputStream fos = new FileOutputStream(newFile);
for (Integer i : list)
{
fos.write(i.byteValue());
}
fos.close();
return newFile;
}
catch (IOException e)
{
e.printStackTrace();
}
}
return null;
}
I then try to load this dll with System.load(); and it throws that Exception.