首页 > 系统服务 > 详细

eclipse中的System.getProperty("user.dir")

时间:2015-01-27 21:57:27      阅读:555      评论:0      收藏:0      [点我收藏+]

eclipse中的System.getProperty("user.dir")


1、在Java Application中,上述中的获取的是Java项目的路径

(1)运行源码

/**
 * 
 */
package com.you.test;

/**
 * @author YouHaiDong
 *
 */
public class Property 
{
	/**
	 * @param args
	 */
	public static void main(String[] args) 
	{
		String path = System.getProperty("user.dir");
		System.out.println("Java Application项目路径:" + path);
	}

}

(2)运行结果

项目路径:E:\Eclipse\workspace\You

2、在Java Web项目中,获取的是eclipse中的安装目录路径




eclipse中的System.getProperty("user.dir")

原文:http://blog.csdn.net/you23hai45/article/details/43202269

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!