I don't know how Germany managed it, but for Japan, I don't think they will be going away anytime soon. Right now, natural gas generators can easily supply Japan's demand, but I am not sure whether that is more expensive or how long it can be done.
My problem with nuclear energy is that the current technology used in nuclear reactors is technically unstable. unlike many other energy sources, nuclear fission is basically an explosion that is kept in control using various techniques. Since the chance of a failure is non-zero, we are always risking a radiation leak of some kind or the other.