Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java stack trace on Windows

Tags:

java

jstack

I need to get a stack trace for a JVM process running on a client machine that uses windows.

The client has the JRE installed but not the JDK.

I want to use JStack but it is not installed and we can't install a JDK on the client's machine. I also tried using AdaptJ stack trace product from a Java Webstart Session but that didn't work because we remote in and get an error about not being the session that started the application at a specified PID.

Essentially I want a way to install JStack without installing the JDK.

like image 334
richs Avatar asked Mar 18 '09 18:03

richs


2 Answers

You probably want to use SendSignal, which was designed for exactly this purpose.

like image 190
Eddie Avatar answered Sep 18 '22 21:09

Eddie


The JDK and associated tools work fine whether "installed" or not, if you just zip up and extract it to a temporary directory, you should be able to run jstack. (No PATH or JAVA_HOME modifications necessary). Just make sure you use the same version that corresponds to the JRE your client has the application running with. At least in the case of JConsole, it seems to fuss if the versions are different. I'm not sure if jstack behaves the same way.

I'm not saying this is the ideal solution, just that it would work. I think jdigital and Eddie's suggestions are better first bets, and even though this shouldn't interfere with an existing java installation the same way running the installer would, the customer may disagree regardless.

like image 44
Joshua McKinnon Avatar answered Sep 21 '22 21:09

Joshua McKinnon