java程序启动参数-D含义详解
生活随笔
收集整理的這篇文章主要介紹了
java程序启动参数-D含义详解
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
D<name>=<value>? :? set a system property??設置系統屬性。
官方解釋:
Set a system property value. If value is a string that contains spaces, you must enclose the string in double quotes:1.java -D參數簡化加入多個jar
??????java命令引入jar時可以-cp參數,但時-cp不能用通配符(多個jar時什么煩要一個個寫,不能*.jar),面通常的jar都在同一目錄,且多于1個。)-Djava.ext.dirs 就可以解決 多個jar的問題
如:
java -Djava.ext.dirs=lib MyClass?
2.可以在運行前配置一些屬性,比如其他屬性
java -Dconf1="wqbin" Myclass可以通過System.getProperty("conf1");獲得這個值
也可以從idea上看:
?
?
3.補充Standard System Properties
?
?
| "file.separator" | Character that separates components of a file path. This is "/" on UNIX and "\" on Windows. |
| "java.class.path" | Path used to find directories and JAR archives containing class files. Elements of the class path are separated by a platform-specific character specified in the?path.separator?property. |
| "java.home" | Installation directory for Java Runtime Environment (JRE) |
| "java.vendor" | JRE vendor name |
| "java.vendor.url" | JRE vender URL |
| "java.version" | JRE version number |
| "line.separator" | Sequence used by operating system to separate lines in text files |
| "os.arch" | Operating system architecture |
| "os.name" | Operating system name |
| "os.version" | Operating system version |
| "path.separator" | Path separator character used in?java.class.path |
| "user.dir" | User working directory |
| "user.home" | User home directory |
| "user.name" | User account name ? |
?
總結
以上是生活随笔為你收集整理的java程序启动参数-D含义详解的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Windows下搭建ARM11裸机开发环
- 下一篇: 未来计算机相关资料,“诺奖级”材料!有望