[jboss-dev] Determining JBoss AS server version by examining install

Scott M Stark sstark at redhat.com
Mon May 14 14:51:17 EDT 2007


Which is also available programatically via the java.lang.Package info
of org.jboss:

// Package information for org.jboss
Package jbossPackage = Package.getPackage("org.jboss");
System.out.println("JBoss " + jbossPackage.getImplementationVersion());

This includes the scm tag and build date. If you want the simple version
string, use the getSpecificationVersion() method. The jdk extcheck dumps
out the version header info of a jar:

[starksm at succubus bin]$ extcheck -verbose run.jar
Target file:run.jar
Specification title:JBossAS
Specification version:5.0.0.Beta3
Specification vendor:JBoss (http://www.jboss.org/)
Implementation version:5.0.0.Beta3 (build: SVNTag=JBoss_5_0_0_Beta3
date=200705030927)
Implementation vendor:JBoss.org

Comparing with file:/usr/java/jdk1.5.0_09/jre/lib/ext/sunjce_provider.jar
Comparing with file:/usr/java/jdk1.5.0_09/jre/lib/ext/dnsns.jar
Comparing with file:/usr/java/jdk1.5.0_09/jre/lib/ext/localedata.jar
No conflicting installed jar found.

Ian Springer wrote:
> What about parsing the MANIFEST.MF file in JBOSS_HOME/bin/run.jar or one
> of the core jars in JBOSS_HOME/client/ or JBOSS_HOME/lib/?
> 
> Tim Fox wrote:
>> I need to determine from an ant script whether the JBoss AS version
>> installed in a particular directory is JBoss AS 4.2.0 or later.
>>
>> Initially I thought I could just look at the JBOSS_HOME env entry, but
>> the user might have installed it in a different directory other than
>> the default jboss-4.2.0.GA directory.
>>
>> Can anyone think of a good/recommended way to do this? Is there a file
>> somewhere in the distro I can parse?




More information about the jboss-development mailing list