首页
学习
活动
专区
圈层
工具
发布
社区首页 >专栏 >java获取jdk、系统、服务器等信息

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

原创
作者头像
用户8671053
修改2021-09-23 14:37:06
修改2021-09-23 14:37:06
1.4K0
举报
文章被收录于专栏:码农的生活码农的生活

1、获取jdk信息

代码语言:javascript
复制
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、获取系统信息

代码语言:javascript
复制
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://&quot; & 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

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档