I have written a Firefox extension. When a menuitem is selected, it checks for Java version. I am getting this exception, when I try to call a Java class inside JavaScript:
uncaught exception: Target applet or JVM process exited abruptly
This is happening after I hibernate my system, if I try to use my Firefox extension then I get this error. If I restart Firefox, it works again. What can I do about it?
Sample code for Firefox extension (overlay.xul
):
<?xml version="1.0"?>
<overlay id="RefMArc-overlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script>
function onRclick_temp() {
try {
//chkJava: java.lang.String;
var vers = java.lang.System.getProperty("java.version");
var ind1 = vers.indexOf(".")+1;
vers = vers.substring(ind1, vers.indexOf(".", ind1));
if( vers < 5 ) {
alert("You need to upgrade java");
return;
}
// to do
} catch(e) {
alert("error:" + e);
}
}
<menupopup id="menu_ToolsPopup">
<menuitem id="helloworld-hello" label="helloworld"
oncommand="onMenuClick();" class="menuitem-iconic"/>
</menupopup>
</toolbox>
</overlay>