M
Mark_Galeck
I have another question on Java (by the way, I am writing an
application which will be a freeware/open source, so I hope this is OK
to pester the gurus here with questions)
I am trying to use JNI - I want to have a Java class Foo have a
method, that is a native C function.
I follow the Sun's tutorial
http://java.sun.com/developer/onlineTraining/Programming/JDCBook/jniexamp.html#examp
exactly, and everything compiles fine, and I have compiled my C .dll
as well (on Win XP). So I am ready to run - ...
Now when I finally try to run the Java application, it throws this
exception when it tries to create the Foo instance:
at Foo.<init>(Foo.java:11)
(...)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
orAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
onstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:
513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
at sun.applet.AppletPanel.createApplet(AppletPanel.java:786)
at sun.applet.AppletPanel.runLoader(AppletPanel.java:715)
at sun.applet.AppletPanel.run(AppletPanel.java:369)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.security.AccessControlException: access denied
(java.lang.Runtim
ePermission loadLibrary.Foo)
Why would this be so??? Thank you for your insights
application which will be a freeware/open source, so I hope this is OK
to pester the gurus here with questions)
I am trying to use JNI - I want to have a Java class Foo have a
method, that is a native C function.
I follow the Sun's tutorial
http://java.sun.com/developer/onlineTraining/Programming/JDCBook/jniexamp.html#examp
exactly, and everything compiles fine, and I have compiled my C .dll
as well (on Win XP). So I am ready to run - ...
Now when I finally try to run the Java application, it throws this
exception when it tries to create the Foo instance:
at Foo.<init>(Foo.java:11)
(...)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
orAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
onstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:
513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
at sun.applet.AppletPanel.createApplet(AppletPanel.java:786)
at sun.applet.AppletPanel.runLoader(AppletPanel.java:715)
at sun.applet.AppletPanel.run(AppletPanel.java:369)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.security.AccessControlException: access denied
(java.lang.Runtim
ePermission loadLibrary.Foo)
Why would this be so??? Thank you for your insights