为什么Java使用-D来表示系统属性? [英] Why does Java use -D to indicate system properties?

查看:175
本文介绍了为什么Java使用-D来表示系统属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么标志指示Java中的System属性 -D ?当然这个字母选择有一些语义,但我不知道它是什么。

Why is the flag that indicates a System property in Java -D? Surely there is some semantics to this letter choice, but I can't guess what it is.

推荐答案

它是设置的简称系统定义。

It is short for setting a system define.

定义调试为是

-Ddebug=yes

有一些历史背景,因为其他编译器使用类似的标志。例如, gcc 使用 -D 来设置预处理器定义。

There is some historical context, as other compilers use similar flags. For example, gcc uses -D to set a preprocessor define.

gcc -D debug=yes test.c

将使用预处理环境编译test.c,其中预处理器变量 debug 设置为 yes

will compile test.c with a preprocessing environment where the preprocessor variable debug is set to yes.

这篇关于为什么Java使用-D来表示系统属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆