This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Applets and the fly likes Can a Runtime task be blocked in Applet? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Can a Runtime task be blocked in Applet?" Watch "Can a Runtime task be blocked in Applet?" New topic
Author

Can a Runtime task be blocked in Applet?

Qunfeng Wang
Ranch Hand

Joined: Jan 28, 2005
Posts: 433
runTime.exec( someOSCommand )

It can execute any command on my Windows platform. It's said Applet running in sandbox, why there aren't some restricts on executing platform commands. Or I need to do some configuration to my IE?

Thanks.


To be or not to be. It's a question.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41599
    
  55
Runtime.exec is prohibited by default. Unless the applet is signed, or the local security policy altered, it can't be used in an applet.
[ July 18, 2007: Message edited by: Ulf Dittmer ]

Ping & DNS - my free Android networking tools app
Qunfeng Wang
Ranch Hand

Joined: Jan 28, 2005
Posts: 433
Thank you.

Then the applet I'm working on must be signed. But I don't see any warning message like starting WebStart. If I accept the signature, then I can run the application. So the user maybe confused when my applet invokes an OS command. Because he just thinks applet can't do this.

What I expect is maybe I still need to use Runtime.exec do something. But I don't want to let the user be frightened.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41599
    
  55
Well, the thinking is that the user understands that if he accepts the certificate, then the applet is allowed to do (just about) anything it pleases. So he shouldn't accept a certificate from someone he doesn't trust not to format his hard drive, or email his personal files to random people.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can a Runtime task be blocked in Applet?