Java is totally viable for nearly anything; it just doesn't work well for games because they require low-level access to graphics hardware (which is definitely not something Java supports).
Also, the state of the JVM on the desktop is kind of sad - also from the graphics perspective. But Java is probably the most performant server-side language out there at this point (if you exempt the masochists who write network code in C/C++).