Search for a specific class in a folder structure recursively

For those of you that have migrated java application from Fusion Middleware 11g to 12c, you will know that a lot has changed in the background.

In my case, I was migrating a workspace application that heavily relied on Fusion Middleware/WebLogic libraries/classes. Some classes had changed packages or jars so changing the Maven dependency version to the current (12.2.1.3.0 in my case) was not enough.

As you know, ORACLE_HOME contains hundreds if not thousand of jars, so I wrote a simple windows command to iterate in ORACLE_HOME folders, open all the jars that it encountered and search for the class name that you pass it.

for /R %G in (*.jar) do @jar -tvf "%G" | find "WSSecurityContext" > NUL && echo %G

Comments