If you are using Windows XP you need to download from the microsoft web site the Java Virtual Machine
http://www.microsoft.com/java/vm/dl_vm40.htm
Microsoft decided not to include the JVM as part of XP due to litigation with Sun Microsystems.
I have just re-read your post and you seem to be saying that sometimes Java works and sometimes it doesn't - if this is the case are you using any type of firewall? try turning off the firewall and re-check your security settings in IE