Here is a nice JAVA online editor, I am using to code some homeworks on JAVA. You can use it anywhere, where you have an internet access. Can save the code, no problems so far.

Java – OneCompiler – Write, run and share Java code online