dev@glassfish.java.net

Detecting what version of the server is installed

From: vince kraemer <Vince.Kraemer_at_Sun.COM>
Date: Fri, 24 Nov 2006 10:09:00 -0800

Is there an API/method that will allow a java program with access to the
installation directory [NOT THE DOMAIN DIRECTORY] determine the version
of the server installed in that directory?

Here is my use case...

When the user registers a domain in the NetBeans plugin, they need to
identify which executables are associated with it... like asadmin. I
have run into situations where users have said that they want to use the
8.2 libraries, etc. to try to communicate with a 9.0 domain... This
doesn't work, but fails in some very confusing ways.

I want to stop users from being able to do this.

So, I need to find a way to compare the version of the
'installation/executable bits' with the version of the 'domain bits'...

I had been using the DOCTYPE that was in the default-domain.xml.template
(until rev 1.47) to do the comparision...

See
http://fisheye5.cenqua.com/browse/glassfish/admin/templates/pe80/default-domain.xml.template?r1=1.46&r2=1.47

Thanks,
vbk