Java is popular because it can do so many things well. You can use Java on either the client or the server, or even both at the same time. This feature makes Java different from other solutions such as PHP because it provides flexibility in determining where an application runs. Unlike many other solutions, Java enjoys wide platform support, so a solution you create for one platform has a good chance of working on other platforms, too. In fact, you'll find numerous Java applications available for download that run on multiple platforms. For example, a single byte-code file (compiled code) can run on Macintosh OS X, OS/2, Unix, VMS, and Windows.
Many developers use Java for both desktop and Web-based applications, although most people equate Java with Web development where it's a much stronger presence. The fact that you can use it for multiple application types makes Java a good solution for many multi-environment scenarios. Even though you'd need to make changes to an application (desktop) to run it as an applet (Web), the changes are minimal compared to other languages. However, make sure you understand the limits of Java compared to platform-specific solutions such as Visual Basic before you decide to use it in more than one place.
Using Java for Web applications has many significant benefits. The most important benefit is that so many platforms support Java natively. You can develop Web-based applications using products such as Shockwave or Flash, but this solution often forces the Web site visitor to download a browser plug-in. Given Microsoft's recent loss of a lawsuit allowing plug-ins, using Macromedia Shockwave or Macromedia Flash might not even be an option in the future (see the eWeek article at http://eletters.eweek.com/zd/cts?d=79-181-2-3-67152-23278-1 for details). Java applications generally work without any additional effort at all on the part of the user . In addition, Java is more capable than most other languages used for Web application presentation because it allows full interactivity between the client and server.
One feature that could be a benefit or a problem, depending on how you view it, is the fact that Java applications rely on a runtime engine that keeps them in a secure environment known as a sandbox. A Java application can only use the resources allotted to it by the runtime engine or Java Virtual Machine (JVM). This feature is beneficial because it improves security and makes it less likely that an errant Java application will cause other applications to fail (crash). The feature can cause problems by making it difficult to access resources the application needs to perform essential tasks such as writing data to the hard drive.
Another feature that you can view as a benefit or problem is the fact that Java tends to take a one size fits all approach to platform support. Yes, every platform requires a special JVM, but that JVM tends to have the same functionality as every other JVM. This means you face fewer problems porting Java applications from one platform to the next . In fact, except for text-based products such as PHP, Java is one of the easiest languages to port. However, the one size fits all approach also means that you'll experience problems using advanced features a specific platform has to offer. Microsoft tried to address the lack of platform-specific support in Java by (among other things) creating its own version of the JVM (see the "Understanding Java Browser Issues" section for details).