0

I am getting the error while loading the library. Here is my code.

package ibm;

import java.util.Properties;

import com.ibm.eNetwork.ECL.ECLErr;
import com.ibm.eNetwork.ECL.ECLSession;

public class connect {
    
    public static void main(String[] args) throws InterruptedException {
        try {
            System.loadLibrary("pcseclj");
            Properties prop = new Properties();
            // prop.put("SESSION_VT_LOCAL_ECHO ", "true");
 
            //prop.put("SESSION_HOST", "local");
            //prop.put("SESSION_PORT", "992");
            prop.put("SESSION_WIN_STATE", "MAX");
            prop.put("SESSION_VT_KEYPAD ", "SESSION_VT_KEYPAD_APPL");
            prop.put("SESSION_VT_LOCAL_ECHO", "SESSION_VT_LOCAL_ECHO_ON");
 
            ECLSession session = new ECLSession(prop);
 
            session.StartCommunication();
            Thread.sleep(5000);
            session.connect();
 
        } catch (ECLErr err) {
            System.out.println("ECL Error!  " + err.GetMsgText());
        }
    }
}

Error:

Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Program Files (x86)\IBM\Personal Communications\pcseclj.dll: The operating system cannot run %1
    at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
    at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2450)
    at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2506)
    at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2705)
    at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2667)
    at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:830)
    at java.base/java.lang.System.loadLibrary(System.java:1890)
    at ibm.connect.main(connect.java:14)

I have the dll file in the path C:\Program Files (x86)\IBM\Personal Communications\pcseclj.dll. This is 32 bit dll , so have used 32 bit jdk for this.

What should be done to get rid of the error?

4
  • 1
    This question is similar to: Can't load a .dll with System.load(path);. If you believe it’s different, please edit the question, make it clear how it’s different and/or how the answers on that question are not helpful for your problem.
    – aled
    Commented Jul 2 at 11:59
  • I have already tried the instructions mentioned in the url you mentioned. That didn’t work. It’s failing load the library System.loadlibrary and throwing the error I mentioned. I m really not sure what I am missing. I have Jdks with 64 bit and 32 bit. I get error as I can load 32 bit DLL on arm 64 bit operating system when I used 64 bit jdk. Then I switched to 32 bit jdk and keep getting above error. Commented Jul 2 at 12:36
  • Which version of the JDK? How do you execute it? How are you sure it is executing the 32bits one?
    – aled
    Commented Jul 2 at 12:48
  • I am using jdk 11.0.23+9 x86 bit. I have chosen this jdk as JRE system library and executing the above code Commented Jul 2 at 12:55

0

Browse other questions tagged or ask your own question.