everyone!
I have a signed applet (named result in html) with a simple function as below:
public void killApplet()
{
AccessController.doPrivileged(new PrivilegedAction<Object>(){
//@Override
public Object run() {
// kill the JVM
System.exit(0); // or any other line here
String str = "any string";
return null;
}
});
}
The Java script code is like:
function exec_java() {
document.result.killApplet();
}
When I click the button to execute the java function:
<button type="button" id="buttontest" onclick="exec_java()">test</button>
It shows up an exception as below:
java.security.AccessControlException: access denied
(java.io.FilePermission C:\Program Files\Java\jdk1.6.0_18\bin read)
I am using Windows XP with IE version as below:
IE 7
Vision: 7.0.5730.13
Any expert and give me a clue how to make this exception gone? Additionally, the weird thing here is I can call a simple function without problem like below:
public int getNumberOfLines(){
return number_of_lines;
}
Any help would be appreciated! PS: Can't post any images cos apparently I am 'new'! Does anyone have a working sample using?
AccessController.doPrivileged(new PrivilegedAction<Object>()
Thanks!
Wu Bi