Click here to Skip to main content
15,892,809 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
while running the java application in eclipse its run, but while running it on web browser its showing exception java.lang.runtimepermission exception: load library.
Posted
Comments
Have you Googled about the Exception and tried some fixes yet?
Member 10486677 13-Jan-14 1:50am    
Yes i do googled that exception and tried almost every thing that i found on the net. But, no fruitful solution.

1 solution

Java applets cannot load native libraries, see the documentation: "What Applets Can and Cannot Do"[^]. You could make your applet 'privileged' (see here: "API for Privileged Blocks"[^]).
 
Share this answer
 
Comments
Member 10486677 13-Jan-14 1:49am    
try
{
AccessController.doPrivileged(new PrivilegedAction()
{
public Object run()
{
try
{
// privileged code goes here, for example:
System.load("/usr/lib/libPrint.so");
return null; // nothing to return
}
catch (Exception e)
{
System.out.println("Unable to load .so");
return null;
}
}
});
}
catch (Exception e)
{
System.out.println("Unable to load Mydll");
}

I do try this privileged, but still cannot load the .so file in applet i.e., running in web browser. Thanks in advance

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900