JAVA获得系统配置文件的System Properties
来个java获得系统配置文件的
public class SystemProperties
{
public static void main(String[] args)
{
Properties properties = System.getProperties();
Iterator<Entry<Object, Object>> iterator = properties.entrySet().iterator();
while (iterator.hasNext())
{
Entry<Object, Object> entry = iterator.next();
System.out.println(entry.getKey() + "===" + ntry.getValue());
}
}
}
结果:
java.runtime.name===Java(TM) SE Runtime Environment
sun.boot.library.path===d:\MyEclipse 10.7\Common\binary\com.sun.java.jdk.win32.x86_1.6.0.013\jre\bin
java.vm.version===11.3-b02
java.vm.vendor===Sun Microsystems Inc.
java.vendor.url===http://java.sun.com/
path.separator===;
java.vm.name===Java HotSpot(TM) Client VM
file.encoding.pkg===sun.io
sun.java.launcher===SUN_STANDARD
user.country===CN
sun.os.patch.level===Service Pack 1
java.vm.specification.name===Java Virtual Machine Specification
user.dir===D:\Workspaces\TIMETEST
java.runtime.version===1.6.0_13-b03
java.awt.graphicsenv===sun.awt.Win32GraphicsEnvironment
java.endorsed.dirs===d:\MyEclipse 10.7\Common\binary\com.sun.java.jdk.win32.x86_1.6.0.013\jre\lib\endorsed
os.arch===x86
java.io.tmpdir===C:\Users\koal\AppData\Local\Temp\
line.separator=== java.vm.specification.vendor===Sun Microsystems Inc.
user.variant===
os.name===Windows Vista
sun.jnu.encoding===GBK
java.library.path===d:\MyEclipse 10.7\Common\binary\com.sun.java.jdk.win32.x86_1.6.0.013\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;d:/MyEclipse 10.7/Common/binary/com.sun.java.jdk.win32.x86_1.6.0.013/jre/bin/client;d:/MyEclipse 10.7/Common/binary/com.sun.java.jdk.win32.x86_1.6.0.013/jre/bin;d:/MyEclipse 10.7/Common/binary/com.sun.java.jdk.win32.x86_1.6.0.013/jre/lib/i386;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x64
java.specification.name===Java Platform API Specification
java.class.version===50.0
sun.management.compiler===HotSpot Client Compiler
os.version===6.1
user.home===C:\Users\koal
user.timezone===
java.awt.printerjob===sun.awt.windows.WPrinterJob
file.encoding===GBK
java.specification.version===1.6
java.class.path===D:\Workspaces\TIMETEST\bin
user.name===koal
java.vm.specification.version===1.0
java.home===d:\MyEclipse 10.7\Common\binary\com.sun.java.jdk.win32.x86_1.6.0.013\jre
sun.arch.data.model===32
user.language===zh
java.specification.vendor===Sun Microsystems Inc.
awt.toolkit===sun.awt.windows.WToolkit
java.vm.info===mixed mode
java.version===1.6.0_13
java.ext.dirs===d:\MyEclipse 10.7\Common\binary\com.sun.java.jdk.win32.x86_1.6.0.013\jre\lib\ext;C:\Windows\Sun\Java\lib\ext
sun.boot.class.path===d:\MyEclipse 10.7\Common\binary\com.sun.java.jdk.win32.x86_1.6.0.013\jre\lib\resources.jar;d:\MyEclipse 10.7\Common\binary\com.sun.java.jdk.win32.x86_1.6.0.013\jre\lib\rt.jar;d:\MyEclipse 10.7\Common\binary\com.sun.java.jdk.win32.x86_1.6.0.013\jre\lib\sunrsasign.jar;d:\MyEclipse 10.7\Common\binary\com.sun.java.jdk.win32.x86_1.6.0.013\jre\lib\jsse.jar;d:\MyEclipse 10.7\Common\binary\com.sun.java.jdk.win32.x86_1.6.0.013\jre\lib\jce.jar;d:\MyEclipse 10.7\Common\binary\com.sun.java.jdk.win32.x86_1.6.0.013\jre\lib\charsets.jar;d:\MyEclipse 10.7\Common\binary\com.sun.java.jdk.win32.x86_1.6.0.013\jre\classes
java.vendor===Sun Microsystems Inc.
file.separator===\
java.vendor.url.bug===http://java.sun.com/cgi-bin/bugreport.cgi
sun.io.unicode.encoding===UnicodeLittle
sun.cpu.endian===little
sun.desktop===windows
sun.cpu.isalist===pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86
JAVA获得系统配置文件的System Properties的更多相关文章
- Java获取系统环境变量(System Environment Variable)和系统属性(System Properties)以及启动参数的方法
系统环境变量(System Environment Variable): 在Linux下使用export $ENV=123指定的值.获取的方式如下: Map<String,String> ...
- java基础50 配置文件类(Properties)
1. 配置文件类Properties的概念 主要生产配置文件与读取配置文件的信息 2.Properties要注意的细节 1.如果配置文件一旦使用了中文,那么在使用store方法生产的配置文件额时候字符 ...
- Java获取系统相关信息System.getProperty()
java.version Java 运行时环境版本 java.vendor Java 运行时环境供应商 java.vendor.url Java 供应商的 URL java.home Java 安装目 ...
- java Spring使用配置文件读取jdbc.properties
Spring使用配置文件读取jdbc.properties 在beans.xml中加入两个必须的bean [html]<bean id="propertyConfigurer" ...
- java中读取配置文件ResourceBundle和Properties两种方式比较
今天在开发的时候,需要把一些信息放到配置文件中,方便后续的修改,注意到用的是ResourceBundle读取配置文件的方式,记得之前也见过使用Properties的方式,就比较好奇这两种方式的区别,网 ...
- Java 几个有用的命令 - All Options, Memory Options, GC Options, System Properties, Thread Dump, Heap Dump
jcmd ##Refer to http://www.cnblogs.com/tang88seng/p/4497725.html java -XX:+PrintFlagsFinal -version ...
- System.Properties和System.getenv区别
网上很多使用的是getProperties.说获得系统变量,但是其实不正确.getProperties中所谓的"system properties"其实是指"java s ...
- Java中系统属性Properties介绍 System.getProperty()参数大全
在JDK文档中System类中有这样的方法getProperties()在此方法的详细介绍中有下面的参数可供使用: java.version Java 运行时环境版本 java.vendor J ...
- 疯狂java笔记(五) - 系统交互、System、Runtime、Date类
一.程序与用户交互(Java的入口方法-main方法): 运行Java程序时,都必须提供一个main方法入口:public static void main(String[] args){} publ ...
随机推荐
- uiautomatorviewer 可以查看到android中的web 元素信息
以知乎社区账号登录使用微博账号为例,使用uiautomatorviewer 可以定位到登录框.密码框,需要结合appium的inspector 1.genymotion 模拟器开启,模拟器安卓系统为4 ...
- ubuntu 14.04下练习lua
随着lua越来越成熟,在服务器中应用也越来越广.自己也想向这方面发展,于是便开始lua的学习. 学习新的语言,应该是先编译.安装.部署开发调试环境,然后练习...可是,我现在并没有项目做啊,我只是想先 ...
- [Regular Expressions] Find Plain Text Patterns
The simplest use of Regular Expressions is to find a plain text pattern. In this lesson we'll look a ...
- 转载: Javah生成JNI头文件出现找不到类的错误
错误: 找不到 'com.chnic.jni.SayHellotoCPP' 的类文件. 上图可以看到错误和解决办法. 不要忘记那个点 javah -classpath . -jni com.chnic ...
- Android -------- 使手机状态栏背景颜色和activity的一致
Activity类中: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInsta ...
- AngularJs练习Demo11引入Jquery
@{ Layout = null; } <!DOCTYPE html> <html> <head> <meta name="viewport&quo ...
- .net简单页面后台绑定下拉框,按钮,分页 前台aspx页面
一.aspx页面 <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Updat ...
- C#调用进程
Process process = new Process(); process.StartInfo.FileName = "123.exe"; process.StartInfo ...
- CString与char *互转总结
1 前言 今天在网上看论坛,发现大家对CString与Char *互转各说一词,其实我发现提问者所说的情况与回答问题的人完全不是同一情况,这里做一总结. 首先大家得清楚一件事,一般在网上提出问题的人大 ...
- Spring技术_邮箱注册_激活_获取验证码
项目结构 项目中用到的sql: create database hrSystem; use hrSystem; CREATE TABLE `emailverificationcode` ( `id` ...