1

I have written an old app long time ago on another computer. This one does not exist any more - and with it all the source is gone - but I still have the app in form of jar files.

Now I need to check my old code what I have done in a particular place in code. I know I can create a Java from it - but I need to check it while it's running...

I have tried javasnoop - but it can not attach. It keeps trying but forever - other apps I can attach to and debug.

is there any other way/tool that can attach to a running jar and debug it?

If that makes a difference: the application is being started with an EXE file and then uses the jar libs...

halfer
  • 19,824
  • 17
  • 99
  • 186
user387184
  • 10,953
  • 12
  • 77
  • 147
  • 1
    @ceving: This is no duplicate of the posted question. Here he can still start the application in debug mode. – chris.tian Feb 11 '14 at 19:03
  • @chris.tian But the answers explain how to attach to a running process which is the problem in this question. – ceving Feb 11 '14 at 19:05
  • I can't start it in debug mode? how? I can just start the PC application like any other one. Or what do you mean? – user387184 Feb 11 '14 at 19:12

1 Answers1

2

You could decompile the jar files with JAD (http://varaneckas.com/jad/), import the project into Eclipse and debug from there (see http://www.vogella.com/tutorials/EclipseDebugging/article.html). Is this what you are looking for?

chris.tian
  • 770
  • 5
  • 13
  • thanks but I cant compile it anymore since I do not have all the libraries.. - it is a very big app! and I just have fortunately somehow kept the most important jars, - not all – user387184 Feb 11 '14 at 19:11
  • Since I do not know anything about your application, I can only recommend an iterative approach: Compile your application stepwise and for every ClassNotFoundException you can check findjar.com to identify the required library. – chris.tian Feb 11 '14 at 19:49