Firstly am not sure if the decompiled version will be exactly same as that of the original file. Moreover, if you have a valid java file with all imports resolved, you can as well edit that file and compile it again. And for decompiling details- you can search in the Beginner or Java General forums.
This is somewhat not encouraged because you would be making use of some else's work. If the code is open sourced then you can download the source directly and this is fine because the original author wanted it to be shared and reused.
Safe? No. You can do your best to make it hard to decompile, by using a code obfuscator, but in the end most of the code can be decompiled. After all, the JVM needs to be able to read the byte code, and therefore so can any decompiler.