Monday, January 10, 2011

How To Show The Actual Command Line That Eclipse Uses To Launch The Java Program?

You can launch a java program in Eclipse. The console view will show the results.
Often times it will be very helpful to know the actual java command line used by Eclipse.
And I often forget how to do that. Here is the answer.
  1. In the menu bar, select Window --> Open Perspective --> Debug.
  2. In the debug view, you can see a simple line of the command you just ran.
  3. Right click on the line and select Properties. You will see the actual command line.

Windows Process Commandline

For a Windows process, you can view it in the Windows Task Manager. By default, Task Manager does not show the command line for the process. But you can go to "View"-->"Select columns..." and then check "Command Line" in the list. Task Manager will display a new column for command lines. But it seems that if the command line is very long, then only part of it will be displayed. There are the following ways to get the full command line.
  1. Download Microsoft's official "Process Explorer". This tool gives more detailed information about the processes. After launching "Process Explorer", you can right-click on a process and then select "Properties". Then click on the "Image" tab to see the full command line.
  2. Use the Windows Management Instrumentation Command-line (WMIC) tool. For example, you can execute the following directly in the Windows command line console:
    wmic path win32_process get name, commandline > commandline.txt
    
    The following will show all available attributes:
    wmic path win32_process get /format:list
    

1 comment:

  1. Just a typo, it should be:

    Right click on the line and select Properties. You will see the actual command line.

    ReplyDelete