Of course, virtually everything uses Java on the web but you really don't need to use the web. Oh...wait...let's toss out Java and use Mumps. I don't think I've every heard of a Mumps virus. Of course, a bazillion people use Java and only seven people use Mumps, but that couldn't possibly explain why Java has more viruses.
Very very few sites use Java. Unless you are playing a game or running some embedded application, there is no need.