Reputation: 1687
I am using eclipse IDE and want to edit the attached source file of the jar file. For doing this i downloaded the src.zip and attached the file, but it is opening as a .class though I am able to read the file (which is a .class file) but i also want to edit the file.
Why I am not allowed to edit it? how to open an attached file with .java extension not .class extension.
thanks in advance
Upvotes: 1
Views: 1610
Reputation: 6136
.class files are not readable by human being unless you decompile it. Many decompilers exist. Carefull about what you are allowed to do and what you aren't, though...
Usually, .java aren't in .jar.
Upvotes: 0
Reputation: 346377
That's not possible. In order to edit the source, you have to unpack the JAR and create an eclipse project, from which you can then create a JAR with the modified code.
Upvotes: 2
Reputation: 10094
Because you have to link it... Source files are not tied to compiled classes in jar, so if you edit it, nothing will happen to the jar file
You have to create a separate project in Eclipse, and rebuild the jar with your modifications
Upvotes: 1