Security

Not all network programs need to run code uploaded from remote systems, but those that do (applets, Java WebStart, agent hosts, distributed computers) need strong security protections. A lot of FUD (fear, uncertainty, and doubt) has been spread around about exactly what remotely loaded Java code, applets in particular, can and cannot do. This is not a tutorial about Java security, but I will mention a few things that code loaded from the network is usually prohibited from doing.

Finally, and most importantly for this tutorial:

These restrictions can be relaxed for digitally signed code. shows the dialog a Java WebStart app uses to ask the user for additional preferences.

Screenshot-8. Java WebStart requesting the user allow unlimited access for remotely loaded code

Even if you sign the app with a verifiable certificate so the warning is a little less blood-curdling, do not expect the user to allow connections to arbitrary hosts. If a program cannot live with these restrictions, you'll need to ask the user to download and install an app, rather than running your program directly from a web site. Java apps are just like any other sort of app: they aren't restricted as to what they can do. If you are writing an app that downloads and executes classes, carefully consider what restrictions should be put in place and design an appropriate security policy to implement those restrictions.