when executing a Java application the process name given to it is usually java.exe or javaw.exe. But how can I make it be called by the name of my application?
Unless you launch Java via JNI in your own custom built executable, the process name will always be java.exe.
There are several java launchers/wrappers that can generate this executable for you.
If you're using the Sun JDK, you can also use the "jps" command line tool to get a detailed list of Java processes running on the box.
If you are launching from a shell sript (at least for bash and possibly for other decent shells) you can use:
exec -a goodname java ...
to launch java and pass "goodname" as the 0th argument, which will be shown as the process name in ps etc.
Assuming that what you are really after is a way to terminate the correct the correct process later on, then an alternative solution is this:
Run ps-ef and you should get a listing that looks something like this:
mruser 7518 7505 4 11:37 pts/3 00:00:00 /usr/lib/jvm/sun-jre-bin-1.5/bin/java -classpath MRD3030_Linked.jar peralex.MyApp
Then "pkill -f peralex.MyApp"
will kill the correct process.