String temp = System.getProperty("pmIndex")的问题 求指点

大地之子 2014-04-15 05:26:32
今天看代码 看到这样一句话 String temp = System.getProperty("pmIndex") 不是很理解
百度了一下 System.getProperty 是获取系统的信息 如果这样 String temp = System.getProperty("java.class.version") 还能猜出大概什么意思 但是pmIndex难道是人为定义的一个变量吗
...全文
1758 13 打赏 收藏 转发到动态 举报
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
yuhouqingchen_2648 2014-05-19
  • 打赏
  • 举报
回复
一般是系统变量或者-D传入或者自定义
teemai 2014-04-16
  • 打赏
  • 举报
回复
不是系统的就是前面定义的
巫巫巫 2014-04-16
  • 打赏
  • 举报
回复
引用 4 楼 u014039623 的回复:
[quote=引用 2 楼 rui888 的回复:] 那就没有
/**
     * Gets the system property indicated by the specified key.
     * <p>
     * First, if there is a security manager, its
     * <code>checkPropertyAccess</code> method is called with the key as
     * its argument. This may result in a SecurityException.
     * <p>
     * If there is no current set of system properties, a set of system
     * properties is first created and initialized in the same manner as
     * for the <code>getProperties</code> method.
     *
     * @param      key   the name of the system property.
     * @return     the string value of the system property,
     *             or <code>null</code> if there is no property with that key.
     *
     * @exception  SecurityException  if a security manager exists and its
     *             <code>checkPropertyAccess</code> method doesn't allow
     *              access to the specified system property.
     * @exception  NullPointerException if <code>key</code> is
     *             <code>null</code>.
     * @exception  IllegalArgumentException if <code>key</code> is empty.
     * @see        #setProperty
     * @see        java.lang.SecurityException
     * @see        java.lang.SecurityManager#checkPropertyAccess(java.lang.String)
     * @see        java.lang.System#getProperties()
     */
    public static String getProperty(String key) {
	checkKey(key);
	SecurityManager sm = getSecurityManager();
        if (sm != null) {
	    sm.checkPropertyAccess(key);
	}
在哪查这个定义的值是多少啊 请指点下啊[/quote]这是源码
teemai 2014-04-16
  • 打赏
  • 举报
回复
大地之子 2014-04-16
  • 打赏
  • 举报
回复
引用 7 楼 wozuiqiangdeaoyi 的回复:
eclipse里ctrl-h 找到file serach,搜索pmIndex,搜索类型*.java,搜完后一个一个找
谢谢 到底没找到啊 System.setProperty("pmIndex") 这里的这个变量是定义在一个配置文件里还是?????
大地之子 2014-04-16
  • 打赏
  • 举报
回复
引用 9 楼 huxiweng 的回复:
不是系统的就是前面定义的
应该是前面定义的 但是我不知道怎么找啊 到底在哪找呢 版主大人 能指点下嘛
wozuiqiangdeaoyi 2014-04-15
  • 打赏
  • 举报
回复
eclipse里ctrl-h 找到file serach,搜索pmIndex,搜索类型*.java,搜完后一个一个找
大地之子 2014-04-15
  • 打赏
  • 举报
回复
引用 5 楼 suciver 的回复:
引用 3 楼 u014039623 的回复:
[quote=引用 1 楼 suciver 的回复:] 系统默认的变量JDK的API中java.lang.System类中有说明,楼主这个是自定义的
那这个自己定义是在哪定义的呢 怎么查呢
在哪定义的那是你自己项目里面有System.setProperty("pmIndex")[/quote]我是接手的别人的项目啊 在项目里哪里看这个值啊
suciver 2014-04-15
  • 打赏
  • 举报
回复
引用 3 楼 u014039623 的回复:
引用 1 楼 suciver 的回复:
系统默认的变量JDK的API中java.lang.System类中有说明,楼主这个是自定义的
那这个自己定义是在哪定义的呢 怎么查呢
在哪定义的那是你自己项目里面有System.setProperty("pmIndex")
大地之子 2014-04-15
  • 打赏
  • 举报
回复
引用 2 楼 rui888 的回复:
那就没有
/**
     * Gets the system property indicated by the specified key.
     * <p>
     * First, if there is a security manager, its
     * <code>checkPropertyAccess</code> method is called with the key as
     * its argument. This may result in a SecurityException.
     * <p>
     * If there is no current set of system properties, a set of system
     * properties is first created and initialized in the same manner as
     * for the <code>getProperties</code> method.
     *
     * @param      key   the name of the system property.
     * @return     the string value of the system property,
     *             or <code>null</code> if there is no property with that key.
     *
     * @exception  SecurityException  if a security manager exists and its
     *             <code>checkPropertyAccess</code> method doesn't allow
     *              access to the specified system property.
     * @exception  NullPointerException if <code>key</code> is
     *             <code>null</code>.
     * @exception  IllegalArgumentException if <code>key</code> is empty.
     * @see        #setProperty
     * @see        java.lang.SecurityException
     * @see        java.lang.SecurityManager#checkPropertyAccess(java.lang.String)
     * @see        java.lang.System#getProperties()
     */
    public static String getProperty(String key) {
	checkKey(key);
	SecurityManager sm = getSecurityManager();
        if (sm != null) {
	    sm.checkPropertyAccess(key);
	}
在哪查这个定义的值是多少啊 请指点下啊
大地之子 2014-04-15
  • 打赏
  • 举报
回复
引用 1 楼 suciver 的回复:
系统默认的变量JDK的API中java.lang.System类中有说明,楼主这个是自定义的
那这个自己定义是在哪定义的呢 怎么查呢
tony4geek 2014-04-15
  • 打赏
  • 举报
回复
那就没有
/**
     * Gets the system property indicated by the specified key.
     * <p>
     * First, if there is a security manager, its
     * <code>checkPropertyAccess</code> method is called with the key as
     * its argument. This may result in a SecurityException.
     * <p>
     * If there is no current set of system properties, a set of system
     * properties is first created and initialized in the same manner as
     * for the <code>getProperties</code> method.
     *
     * @param      key   the name of the system property.
     * @return     the string value of the system property,
     *             or <code>null</code> if there is no property with that key.
     *
     * @exception  SecurityException  if a security manager exists and its
     *             <code>checkPropertyAccess</code> method doesn't allow
     *              access to the specified system property.
     * @exception  NullPointerException if <code>key</code> is
     *             <code>null</code>.
     * @exception  IllegalArgumentException if <code>key</code> is empty.
     * @see        #setProperty
     * @see        java.lang.SecurityException
     * @see        java.lang.SecurityManager#checkPropertyAccess(java.lang.String)
     * @see        java.lang.System#getProperties()
     */
    public static String getProperty(String key) {
	checkKey(key);
	SecurityManager sm = getSecurityManager();
        if (sm != null) {
	    sm.checkPropertyAccess(key);
	}
suciver 2014-04-15
  • 打赏
  • 举报
回复
系统默认的变量JDK的API中java.lang.System类中有说明,楼主这个是自定义的

62,616

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧