Can you make something out of this? 

public class JavaVer {
 public static void main(String[] args) {
   System.out.println("java.version: " +
System.getProperty("java.runtime.version"));
   System.out.println("JAVA_HOME: " + System.getProperty("JAVA_HOME"));
  }
}

D:\DEV\classes>java -version
java version "1.6.0_01"
Java(TM) SE Runtime Environment (build 1.6.0_01-b06)
Java HotSpot(TM) Client VM (build 1.6.0_01-b06, mixed mode, sharing)

D:\DEV\classes>java -DJAVA_HOME="c:\j2sdk1.4.2_10" JavaVer
java.version: 1.6.0_01-b06
JAVA_HOME: c:\j2sdk1.4.2_10


As you can see, "java.version" gives you what "running JVM is currently
using", regardless of what JAVA_HOME says (or any other env var), but
I'm not sure if this is totally borked in Windows Service-land.

You'd then have to compare the two strings to see if they're not equal.
Or if one equals something it shouldn't...


> -----Original Message-----
> From: David kerber [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, June 07, 2007 10:31 AM
> To: Tomcat Users List
> Subject: Re: Programmatically Determine JVM Version used by Tomcat
> 
> bachuba wrote:
> > Hi,
> > I'm fairly new to using Tomcat, but need to determine what 
> JVM version 
> > (or at least the path to it) a running Tomcat service is currently 
> > using on a Windows system.  If I run tomcat5w.exe and click on the 
> > Java tab, I notice the informaiton is listed there, but I 
> would like 
> > to be able to get at that programmatically.  We are currently using 
> > Tomcat version 5.0.28.  Could somone please describe how 
> this could be done?  Thanks.
> >   
> The system property "java.version" will probably give you 
> what you want.
> 
> D
> 
> 
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org To 
> unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to