I am trying to find a Java decompiler just like swf-decompiler, that allows to edit and recompile the source, without having to export it anywhere, and do any external actions. What I want is to very quickly apply small changes to .jars and save them, without taking extra time on manually recompiling java code with other tools, Is there a decompiler like that? Is there anything similar (like .class variable editor) and is it even possible to make a Java decompiler like swf-decompiler?
Recommending a tool is offtopic, but as for the question of whether it is possible, the answer is yes and no.
Java is relatively decompiler friendly, so for simple cases, it should be possible to create such a tool. However, there are some features or patterns that tend to trip up current decompilers, and given the complexity of the language, there is unlikely to ever be a decompiler that can reliably roundtrip arbitrary Java.
Furthermore, while compiling Java loses a lot less information than C, it does lose information. Obviously, you'll lose stuff like comments and whitespace, but under default settings, you'll lose a lot more: local variable names, flags, and types, generic types, compile time annotations, etc. Most of this information is preserved to some extent for reflection purposes, and passing the -g
flag to the compiler can force it to save more information, but you can't get it all back.
So in short, you can do a reasonable job most of the time, but you can't ever do it perfectly all of the time.
Also note that this is for ordinary Java compiled yourself. If the classfiles were not originally written in Java or they are obfuscated at all, you can forget recompiling. Even when decompilers produce readable output, the output is unlikely to be recompileable.
If you want to modify arbitrary jars, what you need is a disassembler and assembler. The best one I know of is Krakatau (Disclosure: I wrote it). The advantage of this is that it will work for any classfiles, even if they are obfuscated. However, it is not user friendly at all. If you don't know your way around the classfile format and bytecode, you won't be able to make more than trivial changes (such as changing a constant string).