Does gcj support java program containing native c function?

Liu, Guangsheng Guangsheng.Liu@Dialogic.com
Mon Oct 23 08:41:00 GMT 2000


 
  I have a question about gcj and JNI. The following is java program. The
java
program has System.loadLibrary("hello") which will load libhello.so. I am
going to 
add more fun in plain C as native method later, and I already have
libhello.so file,
it works fine with other java program if invoke through java interpreter 
"java HelloWorld". 

Now, I issued "gcj --main=HelloWorld -o HelloWorld HelloWorld.java", it
generate
"HelloWorld". However, when I run "HelloWorld", it give me the following
error:

java.lang.UnknownError: Runtime.loadLibrary not implemented

  By the way, I am using Red Hat 6.2, Java JDK1.2.2, libgcj 2.95.1. 

  Any idea or suggestion will be highly appreciated.
  

---------------------------------
  HelloWorld.java  
  class HelloWorld {
     public  void display() { System.out.println("from Java\n"); }
     static {
       System.loadLibrary("hello");
     }
     public static void main( String args[]) {
       new HelloWorld().display();
   }
   



More information about the Java mailing list