2

I am trying to get some info on the internal of my ColdFusion site

struct function get_site_info() output="false"  {

var oSystem = createObject('java','java.lang.System');
var jremodel    = oSystem.getProperty("sun.arch.data.model");
var jrename     = oSystem.getProperty("sun.runtime.name");
var jreversion  = oSystem.getProperty("sun.runtime.version");



var stResult = {CFVERSION = server.ColdFusion.ProductVersion, 
    CFLEVEL = server.ColdFusion.ProductLevel,
    JRENAME = jrename, // Error happens here
    JREVERSION = jreversion };

return stResult;
}   

The error message is

Variable JRENAME is undefined.
4

1 回答 1

4

没有像“sun.runtime.name”这样的属性(或者实际上是 sun.runtime.anything)。

您可能想要java.runtime.name


要查看系统的所有可用属性,请执行以下操作:

<cfdump var=#createObject('java','java.lang.System').getProperties()# />
于 2012-12-01T20:36:19.360 回答