I have read many posts about changing the contents of a file and replace the whole file, but little did I understand.
Referred this too. The .sh is the one that confuses me. Do I need to use .sh in my case too. I don't want to ruin the project by trying something new, without much understanding.
How do I replace a class file in a jar? I have the class file ready from my workspace. All I need to do is replace the already present class file in the jar. Moreover, need I restart the server after replacing, to see effects?
The application server that we are using is IBM websphere.
Should I also navigate to my ear file location in the server? For example, cd aaa/bbb/ccc and then execute the command.
Please help, I am totally new to this.
.sh file is an example of one of the file from jar that you wish to extract it from jar and edit the extracted file and then again archive it back to the jar... in EXAMPLE
so you don't need .sh if your file name is not ending with .sh..
To extract/pull a particular class from your ear:
then overwrite
com/sample/Example.class
with your generated class and finally do:To update the ear file again with updated class file.
PS: This will require you to deploy the ear file again on your app server and then restart the app server. I would also suggest looking into
ant
ormaven
for this task.