0

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.

tu_1329
  • 25
  • 6
  • 4
    Possible duplicate of [Modifying a file inside a jar](http://stackoverflow.com/questions/1224817/modifying-a-file-inside-a-jar) – dreamer Dec 29 '16 at 20:08
  • 1
    @malka I think OP is asking how to modify the program contained in the jar, not necessarily how to change the contents of the jar. – Jason Braucht Dec 29 '16 at 20:09

2 Answers2

2

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 ...

Rolando F
  • 148
  • 3
  • 17
1

Typically a jar will only include compiled (binary) java classes. In order to modify the program, you'll need to obtain the source code, or use a Java decompiler to extract the source from the binaries in the jar.

Jason Braucht
  • 2,358
  • 19
  • 31