Have you indeed installed Java? It's not installed by default in OS X 10.7 Lion. If your system on which you need Java cannot be connected to the Internet, you should be able to download the installer on another computer and copy the installer over to your primary system.
If that update won't install directly, download this one:
install it, and then run the newer update.
If a "not connected to Internet" error persists after installing Java, that's a different problem probably not connected with Java.