Q:

Recover Jar from Running Application

Context: I have a Maven application running, but have deleted the directory it is running in along with all of the code.
Question: Is it possible to find the running .jar somewhere? I know if I do, I can run it through a decompiler and get my code back.
Edit: More context. I ran the application. Then while the application was running the entire directory was deleted. The command to run was  ./mvnw spring-boot:run, so I cannot find the package in the maven repository.

A:

I'm not sure about jar file. However, individual classes of running application are recoverable.
I reckon few options.
You can dump entire process memory and use tools to analyze it's content.
You also can write a Java Agent to extract classes from the running JVM instance.
Or you can use tools like https://github.com/frontfact/jvminspector to browse loaded classes and save them manually.
Once you've recovered classes assembling them into a jar is trivial.
See also: https://reverseengineering.stackexchange.com/questions/14675/extracting-classes-from-running-jvm

