UNIX Socket FAQ

A forum for questions and answers about network programming on Linux and all other Unix-like systems

You are not logged in.

  • Index
  • » Java
  • » Error while loading .a file on AIX machine

#1 2009-10-29 01:22 PM

amrish
Member
Registered: 2009-10-29
Posts: 3

Re: Error while loading .a file on AIX machine

Hi ,
I am getting error while loading a .a file using java .
My java code is

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 was compiled successfully on AIX but when i tried to run it

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.java: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

Offline

#2 2009-10-30 05:27 AM

i3839
Oddministrator
From: Amsterdam
Registered: 2003-06-07
Posts: 2,230

Re: Error while loading .a file on AIX machine

.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).

Offline

#3 2009-10-30 05:32 AM

amrish
Member
Registered: 2009-10-29
Posts: 3

Re: Error while loading .a file on AIX machine

but it should load any type of library. I was unable to compile a .so file.

Offline

#4 2009-10-30 10:44 AM

i3839
Oddministrator
From: Amsterdam
Registered: 2003-06-07
Posts: 2,230

Re: Error while loading .a file on AIX machine

Well, it won't load the library of Alexandria either, will it?

Offline

#5 2009-10-30 10:53 AM

amrish
Member
Registered: 2009-10-29
Posts: 3

Re: Error while loading .a file on AIX machine

I don't know about library of Alxendaria ,,but it is not loading a .so file .

Offline

  • Index
  • » Java
  • » Error while loading .a file on AIX machine

Board footer

Powered by FluxBB