I will try to be brief and simple to the point.
My Java project is designed to run on Java 7 and Java 8, more specifically, at least Java 7. It works very well both on Linux and Windows. My main development platform is Windows 10 and RHEL 8 with the latest version of Eclipse running on Java 8.
My objective is for the program to be able to run on at least Windows Server 2003 to collect some security related information. To do this, it copies both 32bit and 64bit DLLs from the jar file to the temporary folder using `System.getProperty("java.io.tmpdir")`.
Everything is working well on Windows 10 and Java 8 JDK with JNA 5.5.0.
Recently, I set up a test platform running Windows 2003 R2 (64 bit) with Java 7u80. The code was compiled without issue, but when running, I see this strange error message (truncated).
`Unable to load library 'C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\1\jnalfx64.dll':
The specified procedure could not be found.
The specified procedure could not be found.
Native library (win32-x86-64/C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\1\jnalfx64.dll) not found in resource path ([file:/C:/domains/win2003/class/, file:/C:/domains/win2003/lib/commons-collections4-4.1.jar, file:/C:/domains/win2003/lib/jna-5.5.0.jar, file:/C:/domains/win2003/lib/jna-platform-5.5.0.jar, file:/C:/domains/win2003/lib/poi-3.17.jar, file:/C:/domains/win2003/lib/poi-ooxml-3.17.jar, file:/C:/domains/win2003/lib/poi-ooxml-schemas-3.17.jar, file:/C:/domains/win2003/lib/xmlbeans-2.6.0.jar])`
I double-checked the DLL and it is always there (C:\Documents and Settings\Administrator\Local Settings\Temp\1\jnalfx64.dll) again and again.
Here is the code in question.
`SAMSecurityPolicyNative INSTANCE = Native.load(Scanner.getWinLibraryDLL(), SAMSecurityPolicyNative.class, W32APIOptions.UNICODE_OPTIONS);`
.
.
.
` Under Scanner class:
public static String getWinLibraryDLL()
{
// Called by JNA activated classes only
return (winLibraryFileDLL == null) ? "" : winLibraryFileDLL.toAbsolutePath().toString();
}
`
Like I said, the program should work on Java 7 and later. Is there something I am missing out or maybe I never knew something that I was supposed to do to make it right? Anyone has any idea?
Trevor