I've been asked to help figure out why a java application doesn't run as intended.
Edit: Thanks to everyone that answered, but it turned out that the problem was an altogether different one.
In fact, it has nothing to do with java, even though the program is written in java. I've posted another question on ServerFault here if anyone's still interested.
I don't yet know what "not as intended" means. It could be an exception, it could be a disappearing act, it could be the wrong result, or something entirely different.
My expertise is in C#, .NET, Win32, Windows, etc. but not in Java, so I'm guessing they're a bit desperate, and I said I would take a look.
What I'm wondering, is if on this machine, all I have is the application itself, presumably in .jar files, can I debug this?
I will be allowed to bring my own tools that can be installed, etc. so any tips you can give.
Note that I'm not asking if anyone can teach me all I need to know. They already know my expertise is not in java, but I've had some luck with long-shot debugging attempts for similar things before so I guess this is why I've been asked.
So basically:
- Can it be done?
- If yes, what would I need, as a minimum?
Assume I'm enough versed in the use of debuggers and tools, etc. that you don't need to tell me how to use that part, except for what I need to do in order to load the .jar files and hit "Run with debugger".
As an example, I've attempted to make StatSVN run the past few days, so I loaded up Eclipse, imported the contents of the .jar file, and when I try to coach it into running, it complains that there is no main class in the project.
I did get lots of files and "things" into the project, however, and although the java IL is unknown to me, it would be a start, as long as I could coach it into running.
If at all possible, of course.
Ok, I managed to get Eclipse to debug the StatSVN package, but as some of the answers + comments here shows, the information isn't enough to get a grip on what is happening.
What I had to do (and this is probably bleeding obvious to any Java developers out there; please think of me as a caveman prodding a car with a stick and managing to take it out of gear so that it rolls down a hill):
- Edit the project settings, and add an external reference to the StatSVN.jar file (not trying to import the contents as I had tried before)
- Add a dummy Main class, which simply called:
net.sf.statsvn.Main.main(args2);
, and I created a dummy array (whaddyaknow, same syntax as in C#, or is that the other way around? hmmm) with the parameters that would make statsvn run (except that it doesn't handle the log file I threw at it, but that's a different problem).