java运行命令解释
2013-12-10 15:09
316 查看
-Dfile.encoding解释:
在命令行中输入java,在给出的提示中会出现-D的说明:
-D<name>=<value>
set a system property
-D后面需要跟一个键值对,作用是通过命令行向java虚拟机传递一项系统属性
对-Dfile.encoding=UTF-8来说就是设置系统属性file.encoding为UTF-8
那么file.encoding什么意思?字面意思为文件编码。
搜索java源码,只能找到4个文件中包含file.encoding的文件,也就是说只有四个文件调用了file.encoding这个属性。
在java.nio.charset包中的Charset.java中。这段话的意思说的很明确了,简单说就是默认字符集是在java虚拟机启动时决定的,依赖于java虚拟机所在的操作系统的区域以及字符集。
代码中可以看到,默认字符集就是从file.encoding这个属性中获取的。
=====
Java's file.encoding property on Windows platfor
This property is used for the default encoding in Java, all readers and writers would default to using this property. file.encoding is set to the default locale of Windows operationg system since Java 1.4.2. System.getProperty("file.encoding") can be
used to access this property. Code such as System.setProperty("file.encoding", "UTF-8") can be used to change this property. However, the default encoding can be not changed dynamically even this property can be changed. So the conclusion is that the default
encoding can't change after JVM starts. java -dfile.encoding=UTF-8 can be used to set the default encoding when starting a JVM. I have searched for this option Java official documentation. But I can't find it.
在命令行中输入java,在给出的提示中会出现-D的说明:
-D<name>=<value>
set a system property
-D后面需要跟一个键值对,作用是通过命令行向java虚拟机传递一项系统属性
对-Dfile.encoding=UTF-8来说就是设置系统属性file.encoding为UTF-8
那么file.encoding什么意思?字面意思为文件编码。
搜索java源码,只能找到4个文件中包含file.encoding的文件,也就是说只有四个文件调用了file.encoding这个属性。
在java.nio.charset包中的Charset.java中。这段话的意思说的很明确了,简单说就是默认字符集是在java虚拟机启动时决定的,依赖于java虚拟机所在的操作系统的区域以及字符集。
代码中可以看到,默认字符集就是从file.encoding这个属性中获取的。
=====
Java's file.encoding property on Windows platfor
This property is used for the default encoding in Java, all readers and writers would default to using this property. file.encoding is set to the default locale of Windows operationg system since Java 1.4.2. System.getProperty("file.encoding") can be
used to access this property. Code such as System.setProperty("file.encoding", "UTF-8") can be used to change this property. However, the default encoding can be not changed dynamically even this property can be changed. So the conclusion is that the default
encoding can't change after JVM starts. java -dfile.encoding=UTF-8 can be used to set the default encoding when starting a JVM. I have searched for this option Java official documentation. But I can't find it.
相关文章推荐
- [Java入门]UE中设置编译和运行命令
- 在dos下运行java jar包,并把命令村为bat文件
- mac 使用java命令运行class文件提示“错误:找不到或无法加载主类“
- 解决无法在java程序中运行cmd命令的问题
- bat命令运行java程序
- java 在dos窗口下运行命令
- Javac -cp 和 Java -cp 命令解释
- java命令可运行javac命令不可以运行
- 怎么用命令行编译运行Java?cmd中javac和java命令的运用?
- java 运行 dos 命令
- java命令的使用和运行Java程序
- 黑马程序员(学习日记1,DOS命令,java介绍,程序调试,运行,注释)
- 直接复制,保存成jsp。java可以直接运行linux命令。
- java运行jar命令提示没有主清单属性
- cmd运行java和javac命令报“找不到符号”或“找不到或无法加载主类”问题
- uboot命令解释与运行分析
- windows平台下在Cygwin中运行Nutch1。2的抓取命令提示JAVA_HOME not set解决方案
- 使用java命令运行class文件提示“错误:找不到或无法加载主类“的问题分析
- Java使用java命令运行程序出现:找不到主类错误
- 使用Java命令编译运行eclipse的java工程