This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: libgcj.so.5: cannot open shared object file


Thanks. That much worked. Now i can run a non-graphical program, but when i try to run a program with some minimal AWT in it, i get the following:

./HelloAWT
Hello World!
Exception in thread "main" java.awt.AWTError: Cannot load AWT toolkit:
at java.awt.Toolkit.getDefaultToolkit() (/usr/local/gcc3.4/lib/libgcj.so.5.0.0)
at java.awt.Window.getToolkit() (/usr/local/gcc3.4/lib/libgcj.so.5.0.0)
at java.awt.Container.addImpl(java.awt.Component, java.lang.Object, int) (/usr/local/gcc3.4/lib/libgcj.so.5.0.0)
at java.awt.Container.add(java.awt.Component, java.lang.Object) (/usr/local/gcc3.4/lib/libgcj.so.5.0.0)
at HelloAWT.HelloAWT() (/home/bulbul/java/tests/HelloAWT.java:19)
at HelloAWT.main(java.lang.String[]) (/home/bulbul/java/tests/HelloAWT.java:10)
Caused by: java.lang.ClassNotFoundException:
at java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader) (/usr/local/gcc3.4/lib/libgcj.so.5.0.0)
at java.lang.Class.forName(java.lang.String) (/usr/local/gcc3.4/lib/libgcj.so.5.0.0)
at java.awt.Toolkit.getDefaultToolkit() (/usr/local/gcc3.4/lib/libgcj.so.5.0.0)
...5 more


Any solution for this?

Leston


Andrew Haley wrote:
Leston Buell writes:
> Hello. I am running Mandrake 10 and am excited to try out compiling Java > code with AWT or Swing to native code. I have compiled and installed gcc > 3.4 and can compile and link a program like this:
> > prompt$ gcj-3.4 -c -g -O Hello.java
> prompt$ gcj-3.4 --main=Hello -o Hello Hello.o
> > However, i can't run it:
> > prompt$ ./Hello
> prompt$ ./Hello: error while loading shared libraries:
> libgcj.so.5: cannot open shared object file:
> No such file or directory
> > Is there some environement variable i need to set to fix this?


LD_LIBRARY_PATH should point to the dir that contains libgcj.so.5.

Andrew.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]