How to Force Thread Dump in Eclipse?

I'm launching a Weblogic application inside Eclipse via the BEA Weblogic Server v9.2 runtime environment. If this were running straight from the command-line, I'd do a ctrl-BREAK to force a thread dump. Is there a way to do it in Eclipse?

Asked by: Sawyer327 | Posted: 28-01-2022

Answer 1

Indeed (thanks VonC to point to the SO thread), Dustin, in a comment to his message, points to jstack.

I have run a little Java application (with GUI) in Eclipse, I can see the related javaw.exe in Windows' process manager and its PID, 7088 (it is even simpler in Unix, of course).

If I type at a command prompt jstack 7088, I have the wanted stack dump per thread.

Would be better if we could do that directly from Eclipse, but that's already useful as is.

Answered by: Thomas446 | Posted: 01-03-2022

Answer 2

You can do it when you are in debug mode: go to the debug view in the debug perspective, click on the process you have launched and click on pause, you will get a graphical stack of all your processes.

Note : this also works when using remote debugging, you do not need to launch weblogic from eclipse, you can launch it on its own, open the debugging ports and create a "remote java application debug configuration" for it.

Answered by: Anna465 | Posted: 01-03-2022

Answer 3

check SendSignal:

Answered by: Sawyer193 | Posted: 01-03-2022

Answer 4

Eclipse Wiki: How to Report a Deadlock lists all possible options of creating a thread dump in Eclipse. Depending on the concrete situation, one or the other may work better -- my personal favorite on Windows is the Adaptj Stacktrace tool.

Answered by: Lenny391 | Posted: 01-03-2022

Answer 5

StackTrace is another option that you could try. From the features:

Thread dump for Java processes running as a Windows service (like Tomcat, for example), started with javaw.exe, applets running inside any browser or JVMs embedded inside another process. StackTrace works on Windows, Linux and Mac OS X.

Answered by: Dainton669 | Posted: 01-03-2022

Answer 6

if you prefer UI based solution visualvm might be a good choice. (it's advantage is also that it's distributed with JDK)

To take the thread dump in visualvm:

  1. connect to process (remote or local) and
  2. go for Threads (tab) -> Thread Dump (button)

Answered by: Vivian956 | Posted: 01-03-2022

Answer 7

Did you try to launch your eclipse with java.exe instead of javaw.exe (in your eclipse.ini) ?

That might give you the console you need, as described in this bug and in this message.

Other ideas (in term of java options) could be derived from this other SO question.

Answered by: Carlos269 | Posted: 01-03-2022

Answer 8

You can connect through the JVisualVM and get a thread dump. Just right click on the application node from the Applications tree and select "Thread dump"

Answered by: Thomas796 | Posted: 01-03-2022

Answer 9

On linux at least you can do a ps -ef | grep java to get the PID and then do a kill -3 PID and it will output it to the Eclipse console.

Answered by: Madaline887 | Posted: 01-03-2022

Similar questions

java - Eclipse Jobs API using Thread Pools?

is Eclipse 3.0 Jobs API using any internal thread pool for executing jobs? or is it creating a new thread each time a job is scheduled (about to be started)? if it doesn't use any thread pooling, is it somehow possible to use Jobs with Java's ExecutorService so that scheduled jobs will reuse existing threads from the Executor's pool? if not then last question, is there a chance to provide progress feedback ...

java - Debug only one Thread in eclipse

i have many threads running in my application, but i want to debug just only one thread. i'm using eclipse, is that possible? i just saw that stuff in visual studio and in c# Thank you for your help and pacience.

java - Run a thread always in eclipse

I am writing an eclipse plugin which will always check the file in current active editor (if editor changes, then it will check new editor) and then highlight some lines in the editor. (A database contains all file names and associated lines that need to be highlighted). I was succeed to develop the plugin. The problem is, it only checks the database once and produce my own error message if it can't connect to data...

java - How to set up Eclipse TPTP

I need to profile a java application for a customer. It's an eclipse/maven project, so I decided on using eclipse TPTP ( ). I tried to install eclipse TPTP through the update manager from a standard eclipse installation, but I gave up because of the unbelievable complex setup and downloading of dependencies with very cryptic name...

eclipse - Java - change focus on key press

I am writing a Java Application for Data Entry using Eclipse and SWT. Naturally it has a great many Text objects. What I would like to happen is that when user enters something into one field focus automatically changes to the next field. Thanks in advance

java - Eclipse coding style checks as an Ant Task?

In Eclipse I can set all kinds of preferences for coding style. I'd like to be able to enforce these as an ant task to make the build break. Can anyone give me an example of how to enforce eclipse coding styles in an Ant task? (I KNOW about PMD, checkstyle etc - none of these EXACTLY match the eclipse preferences for coding style. I want an ant task that exactly matches the eclipse coding style)

java - How can I build an Eclipse plugin outside of Eclipse?

I have a series of Eclipse projects containing a number of plugins and features that are checked into CVS. I now need to run an automated build of these plugins. Ideally I'd like to do it without having to hardcode large numbers of Eclipse library locations by hand, which has been the problem with the automatically generated Ant files that Eclipse provides. The build also needs to run headlessly. Does anyone have e...

java - Where does Eclipse find javac to compile a project?

Here is what I have: JAVA_HOME=C:\Software\Java\jdk1.5.0_12 (points to JDK 5.0) In Eclipse "Installed Runtimes" I have: jre 1.5.0_12 (points to JRE 5.0) jre 1.6.0_3 (points to JRE 6.0) (this one is default) I do not have "javac" on my PATH (i.e. I cannot run javac -version from command line if I am not in JDK/bin). My project is set to use jre 1.6.0_3 and compiler's Compliance Level is set t...

java - Which is the best Maven Eclipse plugin?

eclipse - Java cannot find symbol compile error

new to Java. I want to use the org.apache.commons.lang.WordUtils package. Tried importing it. Tried downloading it and adding it to my build path. When I use intellisense for the word WordUtils Eclipse auto puts the import statement at the top of the file. I get the following error when compiling: package org.apache.commons.lang import org.apache.commons.lang.WordUtils; ...

java - How to show syntax errors in an eclipse editor plugin

How can I indicate syntax errors (e.g. an illegal sequence of tokens) in an eclipse editor plugin just like in the eclipse Java editor, i.e. by red wriggly underlines, a red marker on the scrollbar that you can jump to, and an explanatory message when you hover over either one? I'm writing an eclipse editor plugin for a custom file format (specifically, the "snake file format" of the Shark3D game engine). I have im...

java - Can I get Eclipse File Search to include IvyDE jars?

The Eclipse File Search dialog doesn't seem to be playing nicely with my IvyDE (2.0.0beta1) dependency jars. That is, my IvyDE brings some-dep.jar/ (class/source), but I don't see any way to get my file search (ctrl+h search) to include these resources when searching for text -- so if MAGIC_FLAG appears only in the Magic class inside some-...

java - How to offer links in an eclipse editor plugin?

I'm writing an eclipse editor plugin for a custom file format and want to offer a way to quickly jump to the definition of an entity from a named reference to it - basically the "open declaration" functionality of the eclipse Java editor. I know I can do this by registering an editor action and putting it in the context menu, but I'd really like the way all Java identifiers turn into links to their declaration when...

Still can't find your answer? Check out these amazing Java communities for help...

Java Reddit Community | Java Help Reddit Community | Java Community | Java Discord | Java Programmers (Facebook) | Java developers (Facebook)