加入收藏 | 设为首页 | 会员中心 | 我要投稿 安卓应用网 (https://www.0791zz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Java > 正文

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

发布时间:2020-05-24 18:26:46 所属栏目:Java 来源:互联网
导读:java获取jdk、系统、服务器等信息

下面是脚本之家 jb51.cc 通过网络收集整理的代码片段。

脚本之家小编现在分享给大家,也给大家做个参考。

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")); 

几个常用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

以上是脚本之家(jb51.cc)为你收集整理的全部代码内容,希望文章能够帮你解决所遇到的程序开发问题。

如果觉得脚本之家网站内容还不错,欢迎将脚本之家网站推荐给程序员好友。

(编辑:安卓应用网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读