日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

java运行命令解释

發布時間:2024/7/23 编程问答 35 豆豆
生活随笔 收集整理的這篇文章主要介紹了 java运行命令解释 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

-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运行命令解释的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。