> > Can anyone confirm the best mechanism to check if a JVM is running in
> > server mode without having to trawl through the application's log
> > files?
>
> String s = System.getProperty("java.vm.name");
> // s = Java HotSpot(TM) Server VM
Is there no command line mechanism to query the JVM?
> > Also, does 1.4.2.x always by default startup in client mode unless
> > "-server" is the first JVM option? Does invoking a JVM in -D64 mode
> > automatically mean it starts in server mode?
>
> The 32-bit JRE (any version) doesn't even have the Server VM.
Not entirely sure what you mean - the system is running on Solaris 9
(Sparc) and I am assuming it is indeed the 64-bit version. This goes
back to my question of is there any mechanism where you can query the
JVM from command line for finding out if it is in server mode or client
mode.
Thanks
Andrew Thompson - 24 Oct 2005 12:36 GMT
>>>Can anyone confirm the best mechanism to check if a JVM is running in
>>>server mode without having to trawl through the application's log
>>>files?
public class ReportVM {
public static void main(String[] args) {
>>String s = System.getProperty("java.vm.name");
>>// s = Java HotSpot(TM) Server VM
System.out.println( s );
}
}
> Is there no command line mechanism to query the JVM?
java ReportVM
(...duhhh!)
Andrew Thompson - 24 Oct 2005 12:41 GMT
(big snip)
> (...duhhh!)
Oops. I meant...
;-)
Roedy Green - 24 Oct 2005 13:48 GMT
>Is there no command line mechanism to query the JVM?
just a parameter to set it. -server

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
Daniel Sjöblom - 24 Oct 2005 13:51 GMT
> Not entirely sure what you mean - the system is running on Solaris 9
> (Sparc) and I am assuming it is indeed the 64-bit version. This goes
> back to my question of is there any mechanism where you can query the
> JVM from command line for finding out if it is in server mode or client
> mode.
If you use a 1.5 VM, the following tool is probably easiest to use:
http://java.sun.com/j2se/1.5.0/docs/tooldocs/share/jinfo.html
If that doesn't suit your needs, take a look at the other
management/troubleshooting tools:
http://java.sun.com/j2se/1.5.0/docs/tooldocs/index.html#manage
If you are stuck with an older VM, you can hook into the VM with a
debugger and get the same kind of info with a little bit of work. Try
jdb for starters:
http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/jdb.html
(it is available on older JVM:s even though that link points to the 1.5
page).
Hope this helps,
Daniel Sjöblom