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 ofjava 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
Why Do I Need a Functional Interface to Work with Lambdas
How to Determine the Primitive Type of a Primitive Variable
How Are Constructors Called During Serialization and Deserialization
How Read Doc or Docx File in Java
Create Simple Pojo Classes (Bytecode) at Runtime (Dynamically)
How to Create a Stream of Regex Matches
String S = New String("Xyz"). How Many Objects Has Been Made After This Line of Code Execute
Netbeans - Error: Could Not Find or Load Main Class
How to Apply Multiple Predicates to a Java.Util.Stream
How to Determine If a String Has Non-Alphanumeric Characters
Creating Unicode Character from Its Number
File Upload Using Selenium Webdriver and Java Robot Class
Detect If Java Application Was Run as a Windows Admin