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

Ales Justin ales.justin at gmail.com
Mon May 14 16:32:42 EDT 2007


Here's what you can also do to determine the version (the passed in home 
parameter points to the JBoss installation director):

    protected String getServerVersion(String home) throws Exception {
        File file = new File(new File(home, "bin"), "run.jar");
        Attributes attributes = new 
JarFile(file).getManifest().getMainAttributes();
        return 
attributes.getValue(Attributes.Name.IMPLEMENTATION_VERSION).split(" ")[0];
    }



More information about the jboss-development mailing list