gcj/196: gcj compiled class will not run because of shared lib error!

mdejong@cygnus.com mdejong@cygnus.com
Sun Apr 9 01:16:00 GMT 2000


>Number:         196
>Category:       gcj
>Synopsis:       gcj compiled class will not run because of shared lib error!
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    apbianco
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Apr 09 01:16:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Mo
>Release:        EGCS from Sat Apr  8
>Organization:
>Environment:
Red Hat 5.2 box.
>Description:
I can not run an gcj compiled executable without
setting the LD_LIBRARY_PATH or passing a special
argument for the runtime linker.

% cat InnerInterface2.java
// File InnerInterface2.java

public class InnerInterface2 {
    interface Inter {
        public static final int NUM = 0;
    }

    public static void main(String[] args) {
        Inter i = new foo();
        System.out.println(i.NUM);
    }
}

class foo implements InnerInterface2.Inter {}



% gcj -o InnerInterface2 --main=InnerInterface2 InnerInterface2.java

% ./InnerInterface2
./InnerInterface2: error in loading shared libraries
libgcj.so.1: cannot open shared object file: No such file or directory

If I pass the the lib directory where libgcj is installed, it seems to
work just fine.

% gcj -o InnerInterface2 --main=InnerInterface2 InnerInterface2.java \
-Wl,-rpath,/mnt/image/install/lib

% ./InnerInterface2
0


I should not need to pass the location where libgcj is installed to
be able to just run an executable produced by gcj. The gcj executable
should do this for me.
>How-To-Repeat:

>Fix:
The location of the lib where libgcj is installed should
be passed to the runtime linker automatically.
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the Java-prs mailing list