Search code examples
javaeclipseapplet

Not being able to edit java class in JAR


Using Eclipse I'm trying to edit an old java applet all I have is a .jar, but I can see the files not being able to edit.... the source code is incomplete, so I wanted to edit it and fix it... anyone knows what can I do?

P.S. I just want to modify and fix the program in that jar.


Solution

  • Well first of all, applets are considered obsolete. (In case you didn't know). The files you are trying to see/edit are inside the .jar. So, for me, the easiest way to access the content of a .jar is just changing the extension from .jar to .zip, after that you can access as it was a regular folder and modify whatever you want there. After done, just change the extension to .jar ... Since .jar is like a "package", modifying code while still inside the .jar is not possible/recommended.

    Edit: After being able to see the files, you might need a decompiler (as it was mentioned by Jason Braucht in his comment). Check this out:

    http://www.javadecompilers.com/

    it is an online tool and lets you decompile .class files ...