|
#1
|
|||
|
|||
|
Hi ,
I am getting error while loading a .a file using java . My java code is Code:
import java.util.*;
import java.lang.*;
import java.net.*;
public class GetOSName
{
public static void main(String argas[]) {
try{
String osName= System.getProperty("os.name");
System.out.println("Operating system name =>"+ osName);
System.out.println("Loading Files");
System.load("/lib/libtest.a");
System.out.println("Files loadeds");
}catch (Exception e){
System.out.println("Exception caught ="+e.getMessage());
}
}
}
It has given me following error Operating system name =>AIX Loading Files Exception in thread "main" java.lang.UnsatisfiedLinkError: /lib/libtest.a: load ENOEXEC on shared library(s) /lib/libtest.a at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.jav a:2120) at java.lang.ClassLoader.loadLibrary(ClassLoader.java :1955) at java.lang.Runtime.load0(Runtime.java:773) at java.lang.System.load(System.java:885) at GetOSName.main(GetOSName.java:13) Please help me in this regards |
|
#2
|
|||
|
|||
|
.a are static libraries useful for compile-time linking, not dynamic runtime linking.
If you want to use it as a dynamic library turn it into a .so (or whatever AIX uses). |
|
#3
|
|||
|
|||
|
but it should load any type of library. I was unable to compile a .so file.
|
|
#4
|
|||
|
|||
|
Well, it won't load the library of Alexandria either, will it?
|
|
#5
|
|||
|
|||
|
I don't know about library of Alxendaria ,,but it is not loading a .so file .
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|