Extracting a specific class file from an EAR file on Unix

I have an ear file that contains about 20 jar files. Now this EAR has a specific jar file that contains jar 1 that contains application class files.

Now I need one line in unix that can extract a specific class file from this jar (jar 1 in this case) present inside the EAR.

+3


source to share


1 answer


I found a way to do it in 2 steps:



  1. Find the file you want:

    jar tvf file.ear | grep file_you_want.abc
    
          

    You will get the required file with its path.

  2. Extract this:

    jar xvf file.ear path/to/file/file.abc
    
          

0


source







All Articles