Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MaxKey单点登录官方(MaxKeyTop)
MaxKey
提交
aed80b59
MaxKey
项目概览
MaxKey单点登录官方(MaxKeyTop)
/
MaxKey
8 个月 前同步成功
通知
75
Star
3
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
MaxKey
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
aed80b59
编写于
10月 02, 2021
作者:
MaxKey单点登录官方
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
show java version when start
上级
f4e076d8
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
87 addition
and
0 deletion
+87
-0
maxkey-common/src/test/java/org/maxkey/word/RunJavaEnvs.java
maxkey-common/src/test/java/org/maxkey/word/RunJavaEnvs.java
+71
-0
maxkey-core/src/main/java/org/maxkey/web/InitializeContext.java
...-core/src/main/java/org/maxkey/web/InitializeContext.java
+16
-0
未找到文件。
maxkey-common/src/test/java/org/maxkey/word/RunJavaEnvs.java
0 → 100644
浏览文件 @
aed80b59
package
org.maxkey.word
;
import
java.util.Iterator
;
import
java.util.Map
;
import
java.util.Properties
;
import
org.apache.commons.lang.SystemUtils
;
import
org.apache.commons.lang3.ArchUtils
;
public
class
RunJavaEnvs
{
public
static
void
main
(
String
[]
args
)
{
Map
<
String
,
String
>
map
=
System
.
getenv
();
for
(
Iterator
<
String
>
itr
=
map
.
keySet
().
iterator
();
itr
.
hasNext
();){
String
key
=
itr
.
next
();
System
.
out
.
println
(
key
+
"="
+
map
.
get
(
key
));
}
System
.
out
.
println
(
SystemUtils
.
JAVA_VENDOR
);
System
.
out
.
println
(
SystemUtils
.
JAVA_COMPILER
);
System
.
out
.
println
(
SystemUtils
.
JAVA_VERSION
);
System
.
out
.
println
(
SystemUtils
.
JAVA_HOME
);
System
.
out
.
println
(
"JAVA_CLASS_VERSION :"
+
SystemUtils
.
JAVA_CLASS_VERSION
);
System
.
out
.
println
(
SystemUtils
.
JAVA_SPECIFICATION_VERSION
);
System
.
out
.
println
(
SystemUtils
.
JAVA_SPECIFICATION_NAME
);
System
.
out
.
println
(
SystemUtils
.
JAVA_SPECIFICATION_VENDOR
);
System
.
out
.
println
(
"JAVA_VM_INFO :"
+
SystemUtils
.
JAVA_VM_INFO
);
System
.
out
.
println
(
SystemUtils
.
JAVA_VM_INFO
);
System
.
out
.
println
(
SystemUtils
.
JAVA_VM_NAME
);
System
.
out
.
println
(
SystemUtils
.
JAVA_VM_VENDOR
);
System
.
out
.
println
(
SystemUtils
.
JAVA_VM_VERSION
);
System
.
out
.
println
(
SystemUtils
.
OS_NAME
);
System
.
out
.
println
(
SystemUtils
.
OS_ARCH
);
System
.
out
.
println
(
SystemUtils
.
OS_VERSION
);
System
.
out
.
println
(
"OS : "
+
SystemUtils
.
OS_NAME
+
"("
+
SystemUtils
.
OS_ARCH
+
" "
+
ArchUtils
.
getProcessor
().
getType
()+
"), version "
+
SystemUtils
.
OS_VERSION
+
""
);
System
.
out
.
println
(
"JAVA : "
+
SystemUtils
.
JAVA_VENDOR
+
" java version "
+
SystemUtils
.
JAVA_VERSION
+
", class "
+
SystemUtils
.
JAVA_CLASS_VERSION
);
System
.
out
.
println
(
"JAVA_VM : "
+
SystemUtils
.
JAVA_VM_NAME
+
" (build "
+
SystemUtils
.
JAVA_VM_VERSION
+
", "
+
SystemUtils
.
JAVA_VM_INFO
+
")"
);
Properties
props
=
System
.
getProperties
();
System
.
out
.
println
(
"Java的运行环境版本:"
+
props
.
getProperty
(
"java.version"
));
System
.
out
.
println
(
"Java的运行环境供应商:"
+
props
.
getProperty
(
"java.vendor"
));
System
.
out
.
println
(
"Java供应商的URL:"
+
props
.
getProperty
(
"java.vendor.url"
));
System
.
out
.
println
(
"Java的安装路径:"
+
props
.
getProperty
(
"java.home"
));
System
.
out
.
println
(
"Java的虚拟机规范版本:"
+
props
.
getProperty
(
"java.vm.specification.version"
));
System
.
out
.
println
(
"Java的虚拟机规范供应商:"
+
props
.
getProperty
(
"java.vm.specification.vendor"
));
System
.
out
.
println
(
"Java的虚拟机规范名称:"
+
props
.
getProperty
(
"java.vm.specification.name"
));
System
.
out
.
println
(
"Java的虚拟机实现版本:"
+
props
.
getProperty
(
"java.vm.version"
));
System
.
out
.
println
(
"Java的虚拟机实现供应商:"
+
props
.
getProperty
(
"java.vm.vendor"
));
System
.
out
.
println
(
"Java的虚拟机实现名称:"
+
props
.
getProperty
(
"java.vm.name"
));
System
.
out
.
println
(
"Java运行时环境规范版本:"
+
props
.
getProperty
(
"java.specification.version"
));
System
.
out
.
println
(
"Java运行时环境规范供应商:"
+
props
.
getProperty
(
"java.specification.vender"
));
System
.
out
.
println
(
"Java运行时环境规范名称:"
+
props
.
getProperty
(
"java.specification.name"
));
System
.
out
.
println
(
"Java的类格式版本号:"
+
props
.
getProperty
(
"java.class.version"
));
System
.
out
.
println
(
"Java的类路径:"
+
props
.
getProperty
(
"java.class.path"
));
System
.
out
.
println
(
"加载库时搜索的路径列表:"
+
props
.
getProperty
(
"java.library.path"
));
System
.
out
.
println
(
"默认的临时文件路径:"
+
props
.
getProperty
(
"java.io.tmpdir"
));
System
.
out
.
println
(
"一个或多个扩展目录的路径:"
+
props
.
getProperty
(
"java.ext.dirs"
));
System
.
out
.
println
(
"操作系统的名称:"
+
props
.
getProperty
(
"os.name"
));
System
.
out
.
println
(
"操作系统的构架:"
+
props
.
getProperty
(
"os.arch"
));
System
.
out
.
println
(
"操作系统的版本:"
+
props
.
getProperty
(
"os.version"
));
System
.
out
.
println
(
"文件分隔符:"
+
props
.
getProperty
(
"file.separator"
));
//在 unix 系统中是"/" System.out.println("路径分隔符:"+props.getProperty("path.separator"));//在 unix 系统中是":" System.out.println("行分隔符:"+props.getProperty("line.separator"));//在 unix 系统中是"/n" System.out.println("用户的账户名称:"+props.getProperty("user.name"));
System
.
out
.
println
(
"用户的主目录:"
+
props
.
getProperty
(
"user.home"
));
System
.
out
.
println
(
"用户的当前工作目录:"
+
props
.
getProperty
(
"user.dir"
));
}
}
maxkey-core/src/main/java/org/maxkey/web/InitializeContext.java
浏览文件 @
aed80b59
...
...
@@ -27,6 +27,8 @@ import javax.servlet.ServletConfig;
import
javax.servlet.ServletException
;
import
javax.servlet.http.HttpServlet
;
import
org.apache.commons.lang.SystemUtils
;
import
org.apache.commons.lang3.ArchUtils
;
import
org.joda.time.DateTime
;
import
org.maxkey.cache.CacheFactory
;
import
org.maxkey.util.PathUtils
;
...
...
@@ -206,7 +208,21 @@ public class InitializeContext extends HttpServlet {
_logger
.
trace
(
key
+
" = "
+
map
.
get
(
key
));
}
_logger
.
debug
(
"APP_HOME"
+
" = "
+
PathUtils
.
getInstance
().
getAppPath
());
_logger
.
debug
(
"OS : "
+
SystemUtils
.
OS_NAME
+
"("
+
SystemUtils
.
OS_ARCH
+
" "
+
ArchUtils
.
getProcessor
().
getType
()+
"),"
+
" version "
+
SystemUtils
.
OS_VERSION
+
""
);
_logger
.
debug
(
"COMPUTER: "
+
map
.
get
(
"COMPUTERNAME"
)
+
", "
+
"USERNAME : "
+
map
.
get
(
"USERNAME"
)
);
_logger
.
debug
(
"JAVA :"
);
_logger
.
debug
(
SystemUtils
.
JAVA_VENDOR
+
" java version "
+
SystemUtils
.
JAVA_VERSION
+
", class "
+
SystemUtils
.
JAVA_CLASS_VERSION
);
_logger
.
debug
(
SystemUtils
.
JAVA_VM_NAME
+
" (build "
+
SystemUtils
.
JAVA_VM_VERSION
+
", "
+
SystemUtils
.
JAVA_VM_INFO
+
")"
);
_logger
.
debug
(
"-----------------------------------------------------------"
);
}
/**
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录