Thanks, Juergen.

Yes.  1.1.8-v1 fixed this problem.  

I got two questions on JNI and thread.  Could someone help me on these?
Thank you.

Environment:  RH6.1, BlackDown 1.1.8_v1

Q1: 

After start the following simple java application
by using "java -native test",

public class test
{
  public static void main(String args[])
  {
    while(true)
    {
      ;
    }
  }
}

command line command "ps -a" shows 4 java (JVM) running.  
Why there are so many JVMs running, and what they are for?

Q2:

I want to load *.so file in a class other than java application's
public class. In this way, the shared lib files are loaded only 
when they are needed.  But the following code doesn't work.

public class ShowMsgBox
{
    static public void main(String args[])
    {
        toNative app = new toNative();
        app.ShowMessage("test from Java app");
    }
}

class toNative
{
    toNative()
    {
        System.loadLibrary("MsgImpl");
    }

    native void ShowMessage(String msg);
}

Got an error msg when run it, the error msg is:
"java.lang.UnsatisfiedLinkError: ShowMessage at
ShowMsgBox.main(ShowMsgBox.java:6)"

It seems libMsgImpl.so is loaded OK, otherwise, it complains about file not
found.

What did I do wrong?

Thank you.


Lee

-----Original Message-----
From: Juergen Kreileder [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 25, 2000 12:38 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: JNI and Dead Thread on Linux


>>>>> Lee Xing writes:

    Lee> Hi Nathan:
    Lee> Thank you for your information.

    Lee> I downloaded jdk_1.1.7-v3-glibc-x86-native.tar.gz and unpack it 
    Lee> from the $JAVA_HOME directory.  When I run "java -native app", I
    Lee> got an error message like:

    Lee> "Cannot open /proc/00762 for GC/mnt/e/Linux/java/jni/Sample3/app", 

This problem has been fixed in 1.1.8-v1.


        Juergen

-- 
Juergen Kreileder, Blackdown Java-Linux Team
http://www.blackdown.org/java-linux.html


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to