wood burning stoves 2.0*
The moose likes Java in General and the fly likes Unique JVM identifier Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Unique JVM identifier" Watch "Unique JVM identifier" New topic
Author

Unique JVM identifier

Ed Ward
Ranch Hand

Joined: Jan 30, 2006
Posts: 147
Greetings all!

Given a single computer running two JVM instances which have been started with identical configurations and command line properties, is there any attribute or environment property which uniquely identifies a given JVM instance?

I thought maybe looping through System.getenv(), but I do not see anything there which identifies the JVM instance.

I found this from awhile back but was wondering if maybe things have changed:

Can an application determine the JVM instance?



Thanks in advance!
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19654
    
  18

There is one unique identifier - the process ID. You can't get this without JNI though, and unique only means unique at that moment. Nothing prevents the system from reusing your JVM process ID for another process after the JVM has shutdown.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Unique JVM identifier
 
Similar Threads
How is the web app chosen
instanceof Marcus Mock 3 No. 6
Can an application determine the JVM instance?
Interface Concept
Synchronizing on a static method