我正在尝试将一个 phidget 接口工具包附加到我的小程序,它给了我这个错误:
java.lang.ExceptionInInitializerError
at AppletTest.init(AppletTest.java:15)
at sun.applet.AppletPanel.run(AppletPanel.java:434)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "loadLibrary.phidget21")
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:366)
at java.security.AccessController.checkPermission(AccessController.java:555)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
at java.lang.SecurityManager.checkLink(SecurityManager.java:835)
at java.lang.Runtime.loadLibrary0(Runtime.java:839)
at java.lang.System.loadLibrary(System.java:1084)
at com.phidgets.Phidget.<clinit>(Phidget.java:26)
... 3 more
我在phidget论坛上问过,没有回答。有没有人对 phidgets 有任何经验并知道发生了什么?
我的代码:
import java.applet.Applet;
import com.phidgets.*;
import com.phidgets.event.*;
import java.awt.*;
public class AppletTest extends Applet implements Runnable
{
private InterfaceKitPhidget ik;
public void init()
{
try
{
ik = new InterfaceKitPhidget();
ik.openAny();
System.out.println("Waiting for interface kit attachement..");
ik.waitForAttachment();
}
catch (PhidgetException e)
{
System.out.println("Phidget Exception");
}
}
public void start()
{
}
public void stop()
{
}
public void destroy()
{
}
public void paint(Graphics g)
{
}
public void run()
{
}
}