java显示当前运行时的参数(java运行参数)
时间:2023-09-07 10:03:22
显示当前运行java代码的运行时的各种参数。
不带显String操作。
package systeminfo;
import java.util.Iterator;
import java.util.Map.Entry;
import java.util.Properties;
public class sysinfo {
public static void main(String[] args) {
Properties p = System.getProperties();
Iterator<Entry<Object, Object>> it= p.entrySet().iterator();
while(it.hasNext()){
Entry<Object,Object> item=it.next();
System.out.print(item.getKey()+"===");
System.out.println(item.getValue());
}
}
}
简单版本
package systeminfo;
public class sysinfo {
public static void main(String[] args) {
String s = System.getProperties().toString();
System.out.println(s);
}
}
String版本
package systeminfo;
public class sysinfo {
public static void main(String[] args) {
String s = System.getProperties().toString();
System.out.println(s);
String[] ss=s.split(",");
for(String e:ss){
System.out.println(e);
}
}
}
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Maven构建生命周期详细介绍
详解Java中的Vector
Android仿抖音列表效果
![](https://img.aspxhome.com/file/2023/1/122091_0s.gif)
将Java对象序列化成JSON和XML格式的实例
Android View事件机制 21问21答
SpringBoot下载Excel文件时,报错文件损坏的解决方案
![](https://img.aspxhome.com/file/2023/6/101976_0s.png)
Springbean的几种注入方式都了解吗
Jmeter分布式压力测试实现过程详解
![](https://img.aspxhome.com/file/2023/0/63040_0s.png)
C# TextBox控件实现只能输入数字的方法
C++异步操作future和aysnc与function和bind
![](https://img.aspxhome.com/file/2023/3/124013_0s.webp)
详解SpringBoot和SpringBatch 使用
Apache和Tomcat有什么区别_动力节点Java学院整理
![](https://img.aspxhome.com/file/2023/3/68783_0s.jpg)
Android中生成、使用Json数据实例
Java中方法名称和泛型相同的用法示例
一文详解Java中Stream流的使用
![](https://img.aspxhome.com/file/2023/0/64800_0s.png)
Android Studio使用Kotlin时,修改代码后运行不生效的解决方法
![](https://img.aspxhome.com/file/2023/0/137760_0s.jpg)
C#操作注册表的方法
解决Android Studio突然不显示logcat日志的问题
![](https://img.aspxhome.com/file/2023/6/106016_0s.jpg)
TOMCAT内存溢出及大小调整的实现方法
C#实现将一个字符串进行翻转显示的6种方法
![](https://img.aspxhome.com/file/2023/5/102315_0s.png)