dev@glassfish.java.net

Re: What JDK installation am I using?

From: vince kraemer <Vince.Kraemer_at_Sun.COM>
Date: Tue, 22 Aug 2006 17:20:29 -0700

Kedar Mhaswade wrote:
> This is a need for programmatic interface
> for JRE version, I believe. Fortunately, Java SE 5.0 has
> a better support with JVM MBeans. Can you:
> - create the AMX AppserverConnectionSource.
> - get the MBeanServerConnection from it.
> - invoke the RuntimeMXBean method getVmVersion().
> (http://java.sun.com/j2se/1.5.0/docs/api/java/lang/management/RuntimeMXBean.html)
>

Are you saying I can do method 1 or method 2 as outlined by this doc...

http://java.sun.com/j2se/1.5.0/docs/api/java/lang/management/package-summary.html#examples
>
> Will that work? (I have not tried, but see no
> reason why it won't).

Probably. It is far better than the nothing that I have at present.
>
> If this works, it is a better way to get anything
> from a "running" VM. [In other words, ask VM about VM
> specifics, not app server :)]
True, true.
>
> Kedar
>
> vince kraemer wrote:
>> Is there a way to determine which JDK installation the server is using?
>>
>> I know this is kind of knowable by parsing AS_JAVA...
>>
>> Is there an AMX method that exposes this to clients?
>>
>> Or even the 'java -version' info?
>>
>> Use Case:
>>
>> The NetBeans IDE may be running against a JDK 6 JVM. The server may
>> be running against that JVM or it may be executing against a J2SE 5
>> JVM. When the server is running against a mismatched JVM revision,
>> NetBeans wants to prevent Bad Things from happening. This api would
>> be instrumental in providing that level of service to our users.
>>
>> vbk
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>