try {
Runtime rt = Runtime.getRuntime();
Method m = rt.getClass().getMethod("maxMemory", new Class[0]);
Long r = (Long) m.invoke(rt, new Object[0]);
return r;
} catch (Exception e) {
e.printStackTrace();
}
return new Long(-1);
}
%>
try {
Runtime rt = Runtime.getRuntime();
Method m = rt.getClass().getMethod("availableProcessors",
new Class[0]);
return (Integer) m.invoke(rt, new Object[0]);
} catch (Exception e) {
e.printStackTrace();
}
return new Integer(-1);
}
%>
String hostName = null;
try {
hostName = java.net.InetAddress.getLocalHost().getHostName();
} catch (java.net.UnknownHostException e) {
hostName = "";
}
return hostName;
}
%>
String hostAddress = null;
try {
hostAddress = java.net.InetAddress.getLocalHost().getHostAddress();
} catch (java.net.UnknownHostException e) {
hostAddress = "";
}
return hostAddress;
}
%>
ThreadGroup group = Thread.currentThread().getThreadGroup();
while (group.getParent() != null) {
group = group.getParent();
}
return group;
}
%>
Calendar cal = Calendar.getInstance();
TimeZone tz = cal.getTimeZone();
String tzId = tz.getID();
int rawOffset = tz.getRawOffset();
int hourOffset = rawOffset / (1000 * 60 * 60);
String tzInfo = "";
if (hourOffset == 0){
tzInfo = "中时区";
}else{
String dir = (hourOffset > 0) ? "东" : "西";
tzInfo = dir + Math.abs(hourOffset) + "区";
}
return tzInfo + "(" + tzId + ")";
}
%>
系统环境信息.version{
border-collapse:collapse
}
.version td{
border:1px solid #999999
}
|