[3198] in java-interest
Re: Native methods as static method
daemon@ATHENA.MIT.EDU (Thomas Ball)
Thu Nov 2 21:40:11 1995
Date: Thu, 2 Nov 1995 15:37:35 -0800
From: Thomas.Ball@Eng.Sun.COM (Thomas Ball)
To: bergold@igd.fhg.de
Cc: java-interest@java.Eng.Sun.COM
It should just work -- many static native methods are defined in the
release. Are you accessing the instance variable (the first one in
any native method)? With static calls that variable is bogus (there
is no instance, just the class itself), and dereferencing it will
most likely fault. Removing the static from your declaration has
the side-effect of passing in a valid instance variable.
Tom Ball
Java Products Group
> From daemon@java Mon Oct 30 09:02:02 1995
> Is it possible to declare a native method as static e.g. static native void f() ?
> I got no compile error, but during the execution I got an access violation
> using the alpha 1.3 release for Windiows NT. There is no problem, when I
> declare the function as follows:
> native void f()
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com