I have a Java program that is executed normally via the terminal. However, when I try to execute it via another python code and more specifically via the os.system() or subprocess.run() functions, I get the following error:
Exception in thread "main" java.lang.UnsatisfiedLinkError: com.slytechs.library.NativeLibrary.dlopen(Ljava/lang/String;)J
at com.slytechs.library.NativeLibrary.dlopen(Native Method)
at com.slytechs.library.NativeLibrary.<init>(Unknown Source)
at com.slytechs.library.JNILibrary.<init>(Unknown Source)
at com.slytechs.library.JNILibrary.loadLibrary(Unknown Source)
at com.slytechs.library.JNILibrary.register(Unknown Source)
at com.slytechs.library.JNILibrary.register(Unknown Source)
at com.slytechs.library.JNILibrary.register(Unknown Source)
at org.jnetpcap.Pcap.<clinit>(Unknown Source)
at cic.cs.unb.ca.jnetpcap.PacketReader.config(PacketReader.java:58)
at cic.cs.unb.ca.jnetpcap.PacketReader.<init>(PacketReader.java:52)
at cic.cs.unb.ca.ifm.Cmd.readPcapFile(Cmd.java:128)
at cic.cs.unb.ca.ifm.Cmd.readPcapDir(Cmd.java:100)
at cic.cs.unb.ca.ifm.Cmd.main(Cmd.java:73)
TCP/IP Features were extracted to: /CICFlowMeter/bin/
To execute the java program, I am using the following command:
subprocess.run( ["/home/user/PycharmProjects/untitled/CICFlowMeter/bin/cfm", "/home/user/PycharmProjects/untitled/CICFlowMeter/bin/", "/home/user/PycharmProjects/untitled/CICFlowMeter/bin/"])
The java program is named cfm and take two parameters as input and particularly the path of two directories. cfm is the CICFlowmeter:
https://github.com/ISCX/CICFlowMeter
Based on the instructions provided by the above GitHub page in order to execute Cicflowmeter I need to install only the libpcap-dev library.
Any idea please?