|
Using ColdFusion to see Java server values |
I've been dabbling in more and more Java recently as an accompaniment to my using ColdFusion development, and I've been finding more and more places where they support each other.
I rolled out a new Application to a live server (this one) and it failed to launch. This was all down to it running an incompatible JVM. So how do you tell what JVM version your server is running? I don't have direct access to this box, so I needed to do it in code.
We are going to use ColdFusion to create a java 'system' object and call the getProperties method on it. This is using the standard CreateObject ColdFusion code.
2
3<cfdump
4var="#systemObj.getProperties()#"
5label="Java system values"
6expand="false">
Just dump the whole returned Structure object out and you have all the server side Java environment values.
The one I was specifically looking for was the 'java.vm.version', which accurately reported that it was too low to run my newly compiled Application.
You can see an example of the code running here: