How to Change the Name of a Java Application Process

How can I give my Java application a unique process name?

The process name is the name of the JVM. So if you rename the jvm you have an other process name. There are some tools which can do that for you. For example Launch4J

how to change the process name of a Java application

Copy your java.exe as customName.exe (and put it in the same location where your java.exe is) and run your program as

customName com.something.something.MyClass
instead of

java com.something.something.MyClass

How can I set the process name for a Java-program?

I don't know if this is possible, but you could use a command line tool that comes with the JDK called 'jps'. It's like *nix ps, but just Java programs instead. jps -v shows all the arguments you have passed to java.

Also, I have seen people attach a "process name" to their java processes by adding an unused -Dmyprocessname to the args.

How to rename java process?

By nature, Java programs are usually interpreted by a JVM. The Java process you see is that JVM instance in fact.

To make what you want, you have to encapsulate the JVM in your own program so that you have apparently only one executable (and no JVM dependencies for your users).

I recommend you to have a look to these free projects:

  • http://jsmooth.sourceforge.net/
  • http://launch4j.sourceforge.net/

Doing a query like "java to exe" in Google can also helps to find the latest news. Looking into gihub could also help to find latest tools.

Note that if you do that, you loose one nice feature of Java which is cross-platform portability.

There are alternatives like JNLP and others.

You also can have a look to this good article

How to rename java.exe/javaw.exe process?

If you are confused by looking at process names that are all the same (java.exe), try to
use Process Explorer instead of Task Manager, and display the command line field. This way, you can see the class or jar arguments that differentiate one process from another.



Related Topics



Leave a reply



Submit