java获取jdk、系统、服务器等信息

转载于:http://techpool.iteye.com/blog/556271  http://www.gbsou.com/2011/05/26/7944.html

 

1、获取jdk信息

System.out.println(System.getProperty("java.version"));   
        System.out.println(System.getProperty("java.vendor"));   
        System.out.println(System.getProperty("java.vendor.url"));   
        System.out.println(System.getProperty("java.home"));   
        System.out.println(System.getProperty("java.vm.specification.version"));   
        System.out.println(System.getProperty("java.vm.specification.vendor"));   
        System.out.println(System.getProperty("java.vm.specification.name"));   
        System.out.println(System.getProperty("java.vm.version"));   
        System.out.println(System.getProperty("java.vm.vendor"));   
        System.out.println(System.getProperty("java.vm.name"));   
        System.out.println(System.getProperty("java.specification.version"));   
        System.out.println(System.getProperty("java.specification.vendor"));   
        System.out.println(System.getProperty("java.specification.name"));   
        System.out.println(System.getProperty("java.class.version"));   
        System.out.println(System.getProperty("java.class.path"));   
        System.out.println(System.getProperty("java.library.path"));   
        System.out.println(System.getProperty("java.io.tmpdir"));   
        System.out.println(System.getProperty("java.compiler"));   
        System.out.println(System.getProperty("java.ext.dirs")); 

2、获取系统信息

System.out.println(System.getProperty("os.name"));   
        System.out.println(System.getProperty("os.arch"));   
        System.out.println(System.getProperty("os.version"));   
        System.out.println(System.getProperty("file.separator"));   
        System.out.println(System.getProperty("path.separator"));   
        System.out.println(System.getProperty("line.separator"));   
        System.out.println(System.getProperty("user.name"));   
        System.out.println(System.getProperty("user.home"));                   
        System.out.println(System.getProperty("user.dir")); 


 

3.获取Tomcat的版本
<%= application.getServerInfo() %> 

 

=========

几个常用Request.ServerVariables的中文

本文件ip路径:<%="
http://" & request.servervariables("server_name")&request.servervariables("script_name") %>
本机ip:<%=request.servervariables("remote_addr")%>
服务器名:<%=Request.ServerVariables("SERVER_NAME")%>
服务器IP:<%=Request.ServerVariables("LOCAL_ADDR")%>
服务器端口:<%=Request.ServerVariables("SERVER_PORT")%>
服务器时间:<%=now%>
IIS版本:<%=Request.ServerVariables("SERVER_SOFTWARE")%>
脚本超时时间:<%=Server.ScriptTimeout%>
本文件路径:<%=server.mappath(Request.ServerVariables("SCRIPT_NAME"))%>
服务器CPU数量:<%=Request.ServerVariables("NUMBER_OF_PROCESSORS")%>
服务器解译引擎:<%=ScriptEngine & "/"& ScriptEngineMajorVersion&"."&ScriptEngineMinorVersion&"."& ScriptEngineBuildVersion %>
服务器操作系统:<%=Request.ServerVariables("OS")%>
支持的文件类型:<%=Request.ServerVariables("HTTP_Accept")%>
访问的文件路径:<%=Request.ServerVariables("HTTP_url")%>
用户代理的信息:<%=Request.ServerVariables("HTTP_USER_AGENT")%>
获取url中的文件名和传过来的值:request.ServerVariables("script_name")+"?"+request.ServerVariableS("QUERY_STRING")

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值